• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pods函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pods函数的典型用法代码示例。如果您正苦于以下问题:PHP pods函数的具体用法?PHP pods怎么用?PHP pods使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pods函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: deleteProject

function deleteProject()
{
    $projid = $_POST['projid'];
    $pod = pods('project');
    $pod->delete($projid);
    exit;
}
开发者ID:centaurustech,项目名称:chipin,代码行数:7,代码来源:functions.php


示例2: export_pod

/**
 * Function, with caching, to export all items of a Pod as a serialized php array or JSON object
 *
 * @param string     $pod_name
 * @param bool 		$json
 *
 * @return bool|mixed|null|string|void
 */
function export_pod($pod_name, $json = true)
{
    //be sure to set your Pod's name here
    //name the transient we are caching in for the Pod.
    $transient_name = "all_{$pod_name}_export";
    //check if we already have this data cached, if not continue
    if (false === ($export = pods_transient_get($transient_name))) {
        //build Pods object, get all items
        $pods = pods($pod_name, array('limit' => -1), true);
        //if we have items, loop through them, adding each item's complete row to the array
        if ($pods && $pods->total() > 0) {
            while ($pods->fetch()) {
                $export[$pods->id()] = $pods->row();
            }
        }
        if ($json) {
            $export = json_encode($export);
        } else {
            $export = serialize($export);
        }
        //cache for next time
        pods_transient_set($transient_name, $export);
    }
    return $export;
}
开发者ID:logoscreative,项目名称:pods-code-library,代码行数:33,代码来源:all-items-to-serialized-array.php


示例3: slug_cpt_ui

/**
 * Note that by setting the second arg to true in pods::ui() these new settings override existing values, but all other values set in Pods Admin remain.
 */
function slug_cpt_ui()
{
    $pods = pods('cpt');
    $override_options['fields'] = array('post_title', 'post_date', 'custom_field');
    $override_options['actions_disabled'] = array('edit', 'delete');
    return $pods->ui($override_options, true);
}
开发者ID:logoscreative,项目名称:pods-code-library,代码行数:10,代码来源:as-admin-page.php


示例4: notification_count

 public static function notification_count()
 {
     global $current_user;
     $yesterday = date('Y-m-d', strtotime("-1 days"));
     $jomiz_dms_data_notifications = pods("jomiz_dms_data_notifications", array("where" => "owner.ID = {$current_user->ID} AND created > '{$yesterday}'", "limit" => -1, "orderby" => "created DESC"));
     //echo "<pre>$jomiz_dms_data_notifications->sql</pre>";
     return $jomiz_dms_data_notifications->total_found();
 }
开发者ID:hasanhalabi,项目名称:jDMS,代码行数:8,代码来源:dms_data.php


示例5: slug_pets_content_filter

function slug_pets_content_filter($content)
{
    if (get_post_type() == 'pets') {
        $obj = pods('pets', get_the_id());
        return $obj->template('pets') . $content;
    }
    return $content;
}
开发者ID:logoscreative,项目名称:pods-code-library,代码行数:8,代码来源:post-type-template-plugin.php


示例6: slug_fundraiser_content_filter

/**
 * Always check if it is a fundraiser page.
 */
function slug_fundraiser_content_filter($content)
{
    if (get_post_type() == 'fundraiser') {
        $obj = pods('fundraiser', get_the_id());
        return $obj->template('Fundraiser Single') . $content;
    }
    return $content;
}
开发者ID:adamdharrington,项目名称:stripe-donate-fundraiser,代码行数:11,代码来源:stripe-donate-fundraiser.php


示例7: pq_tunnel_pod_field

function pq_tunnel_pod_field($fields, $prefix = null)
{
    $out = array();
    // return out if fields are empty
    if (empty($fields)) {
        return $out;
    }
    foreach ($fields as $name => $field) {
        $out[] = $prefix . $name;
        if ($field['type'] === 'file' && $field['options']['file_uploader'] == 'attachment') {
            $out[] = $prefix . $name . '._src';
            $out[] = $prefix . $name . '._img';
            $sizes = get_intermediate_image_sizes();
            foreach ($sizes as &$size) {
                $out[] = $prefix . $name . '._src.' . $size;
            }
            if ('multi' != $field['options']['file_format_type']) {
                foreach ($sizes as &$size) {
                    $out[] = $prefix . $name . '._src_relative.' . $size;
                }
                foreach ($sizes as &$size) {
                    $out[] = $prefix . $name . '._src_schemeless.' . $size;
                }
            }
            foreach ($sizes as &$size) {
                $out[] = $prefix . $name . '._img.' . $size;
            }
        }
        if (!empty($field['table_info'])) {
            if (!empty($field['table_info']['pod'])) {
                if (false === strpos($prefix, $name . '.')) {
                    $pod = pods($field['table_info']['pod']['name']);
                    // only tunnel in if there are object fields
                    if (!empty($field['table_info']['object_fields'])) {
                        $out = array_merge($out, pq_tunnel_pod_field($field['table_info']['object_fields'], $prefix . $name . '.'));
                    }
                    if (post_type_supports($field['table_info']['pod']['name'], 'thumbnail')) {
                        $out[] = 'post_thumbnail';
                        $out[] = 'post_thumbnail_url';
                        $sizes = get_intermediate_image_sizes();
                        foreach ($sizes as &$size) {
                            $out[] = 'post_thumbnail.' . $size;
                            $out[] = 'post_thumbnail_url.' . $size;
                        }
                    }
                    $pod_fields = $pod->fields();
                    $out = array_merge($out, pq_tunnel_pod_field($pod_fields, $prefix . $name . '.'));
                }
            } else {
                if (!empty($field['table_info']['object_fields'])) {
                    $out = array_merge($out, pq_tunnel_pod_field($field['table_info']['object_fields'], $prefix . $name . '.'));
                }
            }
        }
    }
    return $out;
}
开发者ID:dylansmithing,项目名称:leader-of-rock-wordpress,代码行数:57,代码来源:functions-pod_reference.php


示例8: add_notification

 public static function add_notification($owner, $link, $text)
 {
     $data = array();
     $data['target_url'] = $link;
     $data['name'] = $text;
     $data['owner'] = $owner;
     $the_fucken_pod = pods("jomiz_dms_data_notifications");
     $the_fucken_pod->add($data);
 }
开发者ID:hasanhalabi,项目名称:jDMS,代码行数:9,代码来源:dms_messages.php


示例9: get_pod

 /**
  * Get Pod object
  *
  * @since 2.5.6
  *
  * @param $pod_name
  * @param $id
  *
  * @return bool|Pods
  */
 protected static function get_pod($pod_name, $id)
 {
     if (!self::$pod || self::$pod->pod != $pod_name) {
         self::$pod = pods($pod_name, $id, true);
     }
     if (self::$pod && self::$pod->id != $id) {
         self::$pod->fetch($id);
     }
     return self::$pod;
 }
开发者ID:benbrandt,项目名称:pods,代码行数:20,代码来源:PodsRESTHandlers.php


示例10: addEventToCalandar

function addEventToCalandar()
{
    global $current_user;
    get_currentuserinfo();
    $eventId = $_POST['eventId'];
    $calPod = pods('calandar');
    $data = array('author' => $current_user->ID, 'event' => $eventId);
    $newCalItemId = $calPod->add($data);
    echo $newCalItemId;
    exit;
}
开发者ID:Catherinecao,项目名称:Dance-Roomies,代码行数:11,代码来源:functions.php


示例11: add_new_applicant

/**
 * Add a new applicant
 * Real life example of a function to create a new "applicant" record using data submitted from a form.
 *
 * IMPORTANT: Always sanitize data from forms.
 */
function add_new_applicant()
{
    // Get field values from form submission
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $telephone = $_POST['telephone'];
    $email = $_POST['email'];
    $fields = array('first_name' => $first_name, 'last_name' => $last_name, 'telephone' => $telephone, 'email' => $email);
    $new_id = pods('applicant')->add($fields);
    return $new_id;
}
开发者ID:logoscreative,项目名称:pods-code-library,代码行数:17,代码来源:add-from-form.php


示例12: slug_act_img_rel

function slug_act_img_rel($pieces)
{
    //get value of 'img' field
    $img = $pieces['fields']['img']['value'];
    //if it has a value save the value of the permalink field in extended media
    if ($img !== '') {
        $pods = pods('media', $img);
        $data = array('act_permalink' => $pieces['fields']['permalink']['value']);
        $pods->save($data);
    }
}
开发者ID:logoscreative,项目名称:pods-code-library,代码行数:11,代码来源:redirect-attatchment-to-act.php


示例13: surveys

 public static function surveys($evaluation_id)
 {
     $evals = pods('survey', ['limit' => -1, 'where' => 'evaluation.ID = ' . $evaluation_id]);
     $ret = [];
     if ($evals->total()) {
         $all_evals = $evals->data();
         foreach ($all_evals as $key => $eval) {
             $ret[] = $eval;
         }
     }
     return $ret;
 }
开发者ID:strikles,项目名称:php,代码行数:12,代码来源:EvaluationModel.php


示例14: evaluate_duplicated

 public function evaluate_duplicated($fieldname)
 {
     $fieldvalue = $this->current_pod->field($fieldname);
     if ($fieldvalue == "") {
         return "no-duplication";
     }
     $duplicated_pods = pods($this->podname, array("where" => "t.{$fieldname} = '{$fieldvalue}'"));
     if ($duplicated_pods->total() > 1) {
         return "duplicated-found";
     }
     return "no-duplication";
 }
开发者ID:hasanhalabi,项目名称:jDMS,代码行数:12,代码来源:dms_action.php


示例15: set_pod

 /**
  * Set the Pods object
  *
  * @since  2.5.6
  *
  * @access protected
  *
  * @param string|Pods $pod Pods object or name of Pods object
  */
 private function set_pod($pod)
 {
     if (is_string($pod)) {
         $this->set_pod(pods($pod, null, true));
     } else {
         $type = $pod->pod_data['type'];
         if (in_array($type, array('post_type', 'user', 'taxonomy'))) {
             $this->pod = $pod;
         } else {
             $this->pod = false;
         }
     }
 }
开发者ID:dylansmithing,项目名称:leader-of-rock-wordpress,代码行数:22,代码来源:PodsRESTFields.php


示例16: add_database_message

 public static function add_database_message($message, $title, $originator)
 {
     global $jomiz_dms_settings;
     if (!$jomiz_dms_settings->debug_mode) {
         return;
     }
     $data = array();
     $data['name'] = $title;
     $data['originator'] = $originator;
     $data['message'] = $message;
     $debug_pod = pods("dms_data_debug");
     $debug_pod->add($data);
 }
开发者ID:hasanhalabi,项目名称:jDMS,代码行数:13,代码来源:dms_debug.php


示例17: surveys

 public static function surveys($user_id)
 {
     error_log('user model surveys - user id ' . $user_id);
     $user_surveys = pods('survey', ['limit' => -1, 'where' => 'user.ID = ' . $user_id]);
     $ret = [];
     if ($user_surveys->total()) {
         $all_user_surveys = $user_surveys->data();
         error_log('user surveys ' . json_encode($all_user_surveys));
         foreach ($all_user_surveys as $key => $user_survey) {
             $ret[] = $user_survey;
         }
     }
     return $ret;
 }
开发者ID:strikles,项目名称:php,代码行数:14,代码来源:UserModel.php


示例18: sdm_pods_init_action

/**
 * setup pods 
 */
function sdm_pods_init_action()
{
    if (!function_exists('pods')) {
        return;
    }
    $settingsPod = pods('kc_settings');
    if ($settingsPod) {
        KC::$copyright = $settingsPod->field('copyright');
        KC::$author_slug = $settingsPod->field('authors_slug');
        KC::$default_header_image = PodUtils::getImgUrl($settingsPod, 'default_header_image', 'full');
    }
    // SCHEMA
    $schemaPod = pods('schema');
    if ($schemaPod) {
        KC::$schemaOrg = new SchemaOrg($schemaPod);
    }
}
开发者ID:kauaicreative,项目名称:kauaicreative.com,代码行数:20,代码来源:KC.php


示例19: execute_actions

function execute_actions($type, $podname, $pieces, $is_new_item, $id)
{
    $actions_on_pod = pods("jomiz_dms_actions", array("where" => "t.pod_name = '{$podname}' AND t.status = 'active' AND t.action_type = '{$type}'", "orderby" => "execution_order"));
    if ($actions_on_pod->total() > 0) {
        while ($actions_on_pod->fetch()) {
            $arguments = array();
            $arguments["is_new_item"] = $is_new_item;
            $arguments["record_id"] = $id;
            $arguments["podname"] = $podname;
            $arguments["custom_php"] = $actions_on_pod->field("custom_php");
            $arguments["stop_on_error_messages"] = $actions_on_pod->field("stop_on_error_messages");
            //dms_debug::add_database_message(var_export($arguments, TRUE), "Action Found", "pods-actions");
            $actions = new dms_action($arguments);
            $actions->perform();
        }
    }
}
开发者ID:hasanhalabi,项目名称:jDMS,代码行数:17,代码来源:pods-actions.php


示例20: init

 public function init()
 {
     if ($this->init_done) {
         return;
     }
     $settings_pod = pods("jomiz_dms_settings");
     $this->debug_mode = $settings_pod->field("debug_mode");
     $this->groups_members_field_id = $settings_pod->field("groups_members_field_id");
     $this->groups_managers_field_id = $settings_pod->field("groups_managers_field_id");
     $this->dms_workflow_groups_field_id = $settings_pod->field("dms_workflow_groups_field_id");
     $this->login_logo = $settings_pod->field("login_logo");
     $this->top_logo = $settings_pod->field("top_logo._src");
     $this->organization_url = $settings_pod->field("organization_url");
     $this->login_logo = $this->login_logo["guid"];
     //$this -> top_logo = $this -> top_logo["guid"];
     $this->init_done = TRUE;
 }
开发者ID:hasanhalabi,项目名称:jDMS,代码行数:17,代码来源:dms_settings.php



注:本文中的pods函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pods_absint函数代码示例发布时间:2022-05-15
下一篇:
PHP pod_query函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap