当前位置: 首页>>代码示例>>PHP>>正文


PHP papi_property函数代码示例

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


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

示例1: papi_get_box_property

/**
 * Get box property.
 *
 * @param  array $properties
 *
 * @return array
 */
function papi_get_box_property(array $properties)
{
    $box_property = array_filter($properties, function ($property) {
        return !is_object($property);
    });
    if (!empty($box_property) && !isset($box_property[0]) && !isset($box_property[0]['tab'])) {
        $property = papi_property($properties);
        if (!$property->disabled()) {
            $property->_box_property = true;
            $properties = [$property];
        }
    }
    return $properties;
}
开发者ID:KristoferN,项目名称:papi,代码行数:21,代码来源:property.php

示例2: papi_property

<?php

return ['title' => 'Sidebar', papi_property(['slug' => 'sidebar_post', 'title' => __('Sidebar Reference', 'intra'), 'description' => __('Points to another page sidebar', 'intra'), 'type' => 'post', 'settings' => ['placeholder' => 'No page selected, inherit startpage if sidebar empty', 'post_type' => 'page']]), papi_property(['slug' => 'sidebar', 'title' => __('Sidebar', 'intra'), 'description' => __('If no sidebar reference then place modules here!', 'intra'), 'type' => 'relationship', 'rules' => [['operator' => '=', 'value' => null, 'slug' => 'sidebar_post']], 'settings' => ['post_type' => 'module']])];
开发者ID:lobbykit,项目名称:intra,代码行数:3,代码来源:Sidebar.php

示例3: render_json_template

 /**
  * Render layout JSON template.
  *
  * @param string $slug
  */
 protected function render_json_template($slug)
 {
     $options = $this->get_options();
     foreach ($options->settings->items as $key => $value) {
         if (!isset($value['items'])) {
             continue;
         }
         foreach ($value['items'] as $index => $property) {
             $property = $this->prepare_property_for_json(papi_property($property));
             if ($property === false) {
                 unset($options->settings->items[$key]['items'][$index]);
                 continue;
             }
             $options->settings->items[$key]['items'][$index] = $property;
         }
     }
     papi_render_html_tag('script', ['data-papi-json' => esc_attr(sprintf('%s_repeater_json', $slug)), 'type' => 'application/json', papi_maybe_json_encode([$options])]);
 }
开发者ID:nlemoine,项目名称:papi,代码行数:23,代码来源:class-papi-property-flexible.php

示例4: register

 public function register()
 {
     $this->remove(['editor']);
     $this->box('Content', [papi_property(['type' => 'Image', 'title' => 'Hero image']), papi_property(['title' => 'Feature', 'slug' => 'feature_module', 'type' => 'post', 'settings' => ['text' => 'Select module', 'post_type' => ['module', 'post']]])]);
 }
开发者ID:rasmusbe,项目名称:dev-theme,代码行数:5,代码来源:article-page-type.php

示例5: get_properties

 /**
  * Get properties via POST.
  *
  * POST /papi-ajax/?action=get_properties
  */
 public function get_properties()
 {
     if (!papi_get_sanitized_post('properties')) {
         $this->render_error('No properties found');
         return;
     }
     $items = json_decode(stripslashes($_POST['properties']), true);
     if (empty($items) || !is_array($items)) {
         $this->render_error('No properties found');
         return;
     }
     foreach ($items as $key => $item) {
         $property = papi_property((array) $item);
         if (!papi_is_property($property)) {
             unset($items[$key]);
             continue;
         }
         ob_start();
         $property->render_ajax_request();
         $items[$key] = trim(ob_get_clean());
     }
     $items = array_filter($items);
     if (empty($items)) {
         $this->render_error('No properties found');
     } else {
         wp_send_json(['html' => $items]);
     }
 }
开发者ID:ekandreas,项目名称:papi,代码行数:33,代码来源:class-papi-admin-ajax.php

示例6: __

<?php

return ['title' => __('Allmänna modulinställningar', 'lobbykit'), papi_property(['slug' => 'anonymous_only', 'title' => __('Anonym enbart', 'lobbykit'), 'description' => __('Visas endast för anonym besökare', 'lobbykit'), 'type' => 'bool'])];
开发者ID:ekandreas,项目名称:orasolv-intra,代码行数:3,代码来源:module.php

示例7: render_layout_input

    /**
     * Render layout input.
     *
     * @param string $slug
     * @param string $value
     */
    protected function render_layout_input($slug, $value)
    {
        // Creating a fake hidden property to generate right slug.
        $slug = $this->html_name(papi_property(['type' => 'hidden', 'slug' => $slug . $this->layout_key]), $this->counter);
        ?>
		<input type="hidden" name="<?php 
        echo $slug;
        ?>
" value="<?php 
        echo $value;
        ?>
" />
		<?php 
    }
开发者ID:KristoferN,项目名称:papi,代码行数:20,代码来源:class-papi-property-flexible.php

示例8: papi_property

<?php

return ['title' => 'Main', 'description' => 'sasdas', papi_property(['slug' => 'modules', 'title' => __('Modules', 'intra'), 'description' => __('Modules to display on page', 'intra'), 'type' => 'relationship', 'settings' => ['post_type' => 'module']])];
开发者ID:lobbykit,项目名称:intra,代码行数:3,代码来源:Module.php

示例9: register

 public function register()
 {
     $this->box(__('Innehåll', 'aekeb'), [papi_property(['slug' => 'headline', 'title' => __('Rubrik', 'aekab'), 'description' => __('Förstarubrik i text', 'aekab'), 'type' => 'string']), papi_property(['slug' => 'intro', 'title' => __('Introduktionstext', 'aekab'), 'type' => 'text']), papi_property(['slug' => 'headline2', 'title' => __('Andrarubrik, inledning', 'aekab'), 'description' => __('Under intro och före textblocken', 'aekab'), 'type' => 'string']), papi_property(['slug' => 'blocks', 'title' => __('Textblock', 'aekab'), 'description' => __('Flera rader med innehållsblock', 'aekab'), 'type' => 'repeater', 'settings' => ['items' => [papi_property(['slug' => 'headline', 'title' => __('Rubrik', 'aekab'), 'description' => __('Förstarubrik i text', 'aekab'), 'type' => 'string']), papi_property(['slug' => 'text', 'title' => __('Text', 'aekab'), 'type' => 'text'])]]])]);
     $this->box(__('Kontaktinnehåll', 'aekab'), [papi_property(['slug' => 'contact', 'title' => __('Modul för kontakt', 'aekab'), 'description' => __('Vilken kontakt ska denna text peka på för utvisning?', 'aekab'), 'type' => 'post', 'settings' => ['placeholder' => __('Välj en modul som är kontakt', 'aekab'), 'post_type' => ['module'], 'query' => ['meta_key' => PAPI_PAGE_TYPE_KEY, 'meta_value' => 'modules/contact']]])]);
 }
开发者ID:ekandreas,项目名称:aekab,代码行数:5,代码来源:contact-content.php

示例10: register

 public function register()
 {
     $this->remove(['editor']);
     $this->box('Content', [papi_property(['title' => 'Sections', 'type' => 'flexible', 'sidebar' => false, 'settings' => ['items' => [['title' => 'Twitter', 'items' => [papi_property(['title' => 'Twitter name 1', 'type' => 'string']), papi_property(['title' => 'Twitter name 2', 'type' => 'string']), papi_property(['title' => 'Twitter name 3', 'type' => 'string'])]], ['title' => 'Images', 'items' => [['title' => 'Image left', 'type' => 'image'], ['title' => 'Image right', 'type' => 'image']]], ['title' => 'Editor', 'items' => [papi_property(['title' => 'Editor', 'type' => 'editor'])]]]]])]);
 }
开发者ID:rasmusbe,项目名称:dev-theme,代码行数:5,代码来源:flexible-page-type.php

示例11: register

 public function register()
 {
     $this->box(__('Authentication', 'intra'), [papi_property(['slug' => 'profile_page', 'title' => __('Profile page', 'intra'), 'type' => 'post', 'settings' => ['placeholder' => __('No profile page set!', 'intra'), 'post_type' => 'page']])]);
     $this->box(__('Mandrill settings', 'intra'), [papi_property(['slug' => 'mandrill_from_name', 'title' => __('From Name', 'intra'), 'type' => 'string']), papi_property(['slug' => 'mandrill_from', 'title' => __('From Email', 'intra'), 'type' => 'string']), papi_property(['slug' => 'mandrill_key', 'title' => __('Secret Key', 'intra'), 'type' => 'string'])]);
 }
开发者ID:lobbykit,项目名称:intra,代码行数:5,代码来源:ThemeOptions.php

示例12: register

 public function register()
 {
     $this->box(__('Authentication', 'intra'), [papi_property(['slug' => 'message_login', 'title' => __('Login', 'intra'), 'description' => __('Shows when the user tries to login to LobbyKit', 'intra'), 'type' => 'editor']), papi_property(['slug' => 'message_forgot', 'title' => __('Forgot', 'intra'), 'description' => __('When the user tries to get a login link', 'intra'), 'type' => 'editor']), papi_property(['slug' => 'message_register', 'title' => __('Register', 'intra'), 'description' => __('When the user tries to register new account', 'intra'), 'type' => 'editor']), papi_property(['slug' => 'message_new_account', 'title' => __('New account success', 'intra'), 'description' => __('When a new account is created with the green new message to user', 'intra'), 'type' => 'editor']), papi_property(['slug' => 'message_email_welcome', 'title' => __('Email welcome', 'intra'), 'description' => __('Email text when user gets new welcome mail', 'intra'), 'type' => 'editor'])]);
 }
开发者ID:lobbykit,项目名称:intra,代码行数:4,代码来源:MessageOptions.php

示例13: register

 public function register()
 {
     $this->box(__('test', 'intra'), [papi_property(['slug' => 'test', 'title' => __('TEST', 'intra'), 'type' => 'string'])]);
     $this->box(__('Bildspel', 'intra'), [papi_property(['slug' => 'carousel', 'title' => __('Bilder', 'intra'), 'type' => 'repeater', 'settings' => ['items' => [papi_property(['slug' => 'image', 'title' => __('Bild', 'intra'), 'type' => 'image']), papi_property(['slug' => 'link', 'title' => __('Destination', 'intra'), 'type' => 'link'])]]])]);
     $this->box(dirname(__FILE__) . '/parts/module.php');
 }
开发者ID:ekandreas,项目名称:orasolv-intra,代码行数:6,代码来源:carousel.php

示例14: register

 public function register()
 {
     $this->box(__('Payoffens inställningar', 'aekab'), [papi_property(['slug' => 'words', 'title' => __('Innehåll', 'aekab'), 'description' => __('Den text som visas ut som payoff', 'aekab'), 'type' => 'text']), papi_property(['slug' => 'type', 'title' => __('Typ av payoff', 'aekab'), 'description' => __('Välj vilken sort som ska visas ut', 'aekab'), 'type' => 'dropdown', 'default' => 1, 'settings' => ['items' => [__('Vit', 'aekab') => 1, __('Grå', 'aekab') => 2]]])]);
 }
开发者ID:ekandreas,项目名称:aekab,代码行数:4,代码来源:payoff.php

示例15: register

 /**
  * Register content meta box.
  */
 public function register()
 {
     $this->box('Medialistningar', [papi_property(['title' => 'Medialistning', 'slug' => 'relation', 'type' => 'relationship', 'settings' => ['post_type' => 'module', 'query' => ['meta_key' => PAPI_PAGE_TYPE_KEY, 'meta_value' => 'modules/medialisting']]]), papi_property(['title' => 'Ordning', 'slug' => 'sort_order', 'type' => 'number', 'description' => 'Lägst går först i listningar', 'default' => '100'])]);
 }
开发者ID:ekandreas,项目名称:orasolv-intra,代码行数:7,代码来源:media.php


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