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


PHP FLBuilderModel::get_post_types方法代码示例

本文整理汇总了PHP中FLBuilderModel::get_post_types方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::get_post_types方法的具体用法?PHP FLBuilderModel::get_post_types怎么用?PHP FLBuilderModel::get_post_types使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FLBuilderModel的用法示例。


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

示例1: preventNested

    /**
     * preventNested
     *
     * Display a warning on post edit pages when:
     *   - Beaver Builder is active on that post
     *   - The post is using a Content Template that also has Beaver Builder active
     *
     * @param $post WP_Post object
     *
     * @since 2.2
     */
    public function preventNested($post)
    {
        $beaver_post_types = FLBuilderModel::get_post_types();
        if (in_array($post->post_type, $beaver_post_types)) {
            $post_has_ct = get_post_meta($post->ID, '_views_template', true);
            $ct_has_beaver = false;
            if ($post_has_ct) {
                $ct_has_beaver = get_post_meta($post_has_ct, '_fl_builder_enabled', true);
            }
            $post_has_beaver = get_post_meta($post->ID, '_fl_builder_enabled', true);
            if ($ct_has_beaver && $post_has_beaver) {
                $post_type_object = get_post_type_object($post->post_type);
                $ct_title = get_the_title($post_has_ct);
                ?>
				<div class="toolset-alert toolset-alert-error">
					<p><strong><?php 
                echo sprintf(__('%1$s %2$s design inside %2$s templates may cause problems', 'wpv-views'), '<i class="fa fa-exclamation-triangle fa-lg" aria-hidden="true"></i>', $this->editor->getName(), $this->editor->getName());
                ?>
</strong></p>
					<p>
						<?php 
                echo sprintf(__('You are using %1$s to design this page, but there is already a template <em>%2$s</em> created by %3$s for %4$s. This may work, but could produce visual glitches. Please consider using %5$s only for the template OR for this page.', 'wpv-views'), $this->editor->getName(), $ct_title, $this->editor->getName(), '<em>' . $post_type_object->labels->name . '</em>', $this->editor->getName());
                ?>
					</p>
					<p>
						<?php 
                echo sprintf(__('%1$sDesigning templates with %2$s%3$s.', 'wpv-views'), '<a href="#" target="_blank">', $this->editor->getName(), '</a>');
                ?>
					</p>
				</div>
				<?php 
            }
        }
    }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:45,代码来源:backend.php

示例2: _e

				
			<?php 
} else {
    ?>
			
				<p><?php 
    _e('Select the post types you would like the builder to work with.', 'fl-builder');
    ?>
</p>
				<p><?php 
    _e('NOTE: Not all custom post types may be supported.', 'fl-builder');
    ?>
</p>
	
				<?php 
    $saved_post_types = FLBuilderModel::get_post_types();
    $post_types = get_post_types(array('public' => true), 'objects');
    $post_types = apply_filters('fl_builder_admin_settings_post_types', $post_types);
    foreach ($post_types as $post_type) {
        $checked = in_array($post_type->name, $saved_post_types) ? 'checked' : '';
        if ($post_type->name == 'attachment') {
            continue;
        }
        if ($post_type->name == 'fl-builder-template') {
            continue;
        }
        ?>
					<p>
						<label>
							<input type="checkbox" name="fl-post-types[]" value="<?php 
        echo $post_type->name;
开发者ID:nullality,项目名称:FEWD-SEA-7,代码行数:30,代码来源:admin-settings-post-types.php

示例3: render_row_actions_link

 /**
  * Renders the action link for post listing pages.
  *
  * @since 1.0
  * @param array $actions
  * @return array The array of action data.
  */
 public static function render_row_actions_link($actions = array())
 {
     global $post;
     if (current_user_can('edit_post', $post->ID) && wp_check_post_lock($post->ID) === false) {
         $post_types = FLBuilderModel::get_post_types();
         if (in_array($post->post_type, $post_types)) {
             $actions['fl-builder'] = '<a href="' . FLBuilderModel::get_edit_url() . '">' . FLBuilderModel::get_branding() . '</a>';
         }
     }
     return $actions;
 }
开发者ID:onedaylabs,项目名称:yote2016.com,代码行数:18,代码来源:class-fl-builder-admin-posts.php


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