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


PHP FLBuilder::render_editor_content方法代码示例

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


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

示例1: save_layout

 /**
  * Saves layout data when a user chooses to publish. 
  *
  * @since 1.0
  * @param bool $publish Whether to publish the parent post or not.
  * @return void
  */
 public static function save_layout($publish = true)
 {
     $editor_content = FLBuilder::render_editor_content();
     $post_id = self::get_post_id();
     $data = self::get_layout_data('draft', $post_id);
     $settings = self::get_layout_settings('draft', $post_id);
     // Fire the before action.
     do_action('fl_builder_before_save_layout', $post_id, $publish, $data, $settings);
     // Delete the old published layout.
     self::delete_layout_data('published', $post_id);
     self::delete_layout_settings('published', $post_id);
     // Save the new published layout.
     self::update_layout_data($data, 'published', $post_id);
     self::update_layout_settings($settings, 'published', $post_id);
     // Clear the asset cache.
     self::delete_all_asset_cache($post_id);
     self::delete_node_template_asset_cache($post_id);
     // Enable the builder to take over the post content.
     self::enable();
     // Get the post status.
     $post_status = get_post_status($post_id);
     // Publish the post?
     if ($publish) {
         $is_draft = strstr($post_status, 'draft');
         $is_pending = strstr($post_status, 'pending');
         if (current_user_can('publish_posts')) {
             $post_status = $is_draft || $is_pending ? 'publish' : $post_status;
         } else {
             if ($is_draft) {
                 $post_status = 'pending';
             }
         }
     }
     // Update the post with stripped down content.
     wp_update_post(array('ID' => self::get_post_id(), 'post_status' => $post_status, 'post_content' => $editor_content));
     // Fire the after action.
     do_action('fl_builder_after_save_layout', $post_id, $publish, $data, $settings);
 }
开发者ID:onedaylabs,项目名称:onedaylabs.com,代码行数:45,代码来源:class-fl-builder-model.php

示例2: save_layout

 /**
  * Saves layout data when a user chooses to publish. 
  *
  * @since 1.0
  * @param bool $publish Whether to publish the parent post or not.
  * @return void
  */
 public static function save_layout($publish = true)
 {
     $editor_content = FLBuilder::render_editor_content();
     $post_id = self::get_post_id();
     $data = self::get_layout_data('draft', $post_id);
     // Delete the old published layout.
     self::delete_layout_data('published', $post_id);
     // Save the new published layout.
     self::update_layout_data($data, 'published', $post_id);
     // Clear the asset cache.
     self::delete_all_asset_cache($post_id);
     self::delete_node_template_asset_cache($post_id);
     // Enable the builder to take over the post content.
     self::enable();
     // Get the post status.
     $post_status = get_post_status($post_id);
     // Publish the post?
     if ($publish) {
         $post_status = strstr($post_status, 'draft') ? 'publish' : $post_status;
     }
     // Update the post with stripped down content.
     wp_update_post(array('ID' => self::get_post_id(), 'post_status' => $post_status, 'post_content' => $editor_content));
 }
开发者ID:ImtiH,项目名称:BAPWD,代码行数:30,代码来源:class-fl-builder-model.php


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