PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/themes/platform/sections/features/section.features.php

https://bitbucket.org/crypticrod/sr_wp_code
PHP | 592 lines | 476 code | 85 blank | 31 comment | 63 complexity | b9d5effb788df3a1b8a099f096aff502 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, GPL-3.0, LGPL-2.0, AGPL-3.0
  1. <?php
  2. /*
  3. Section: PageLines Features
  4. Author: Andrew Powers
  5. Description: Creates a feature slider and custom post type
  6. Version: 1.0.0
  7. */
  8. class PageLinesFeatures extends PageLinesSection {
  9. function __construct( $registered_settings = array() ) {
  10. $name = __('PageLines Features', 'pagelines');
  11. $id = 'feature';
  12. $this->tax_id = 'feature-sets';
  13. $section_root_url = $registered_settings['base_url'];
  14. $default_settings = array(
  15. 'description' => 'This is your main feature slider. Add feature text and media through the admin panel.',
  16. 'icon' => $section_root_url.'/features.png',
  17. 'version' => 'pro',
  18. );
  19. $settings = wp_parse_args( $registered_settings, $default_settings );
  20. parent::__construct($name, $id, $settings);
  21. }
  22. function section_persistent(){
  23. /*
  24. Create Custom Post Type
  25. */
  26. $args = array(
  27. 'label' => __('Features', 'pagelines'),
  28. 'singular_label' => __('Feature', 'pagelines'),
  29. 'description' => 'For setting slides on the feature page template',
  30. 'taxonomies' => array('feature-sets')
  31. );
  32. $taxonomies = array(
  33. 'feature-sets' => array(
  34. "label" => __('Feature Sets', 'pagelines'),
  35. "singular_label" => __('Feature Set', 'pagelines'),
  36. )
  37. );
  38. $columns = array(
  39. "cb" => "<input type=\"checkbox\" />",
  40. "title" => "Title",
  41. "feature-description" => "Text",
  42. "feature-media" => "Media",
  43. "feature-sets" => "Feature Sets"
  44. );
  45. $column_value_function = 'feature_column_display';
  46. $this->post_type = new PageLinesPostType($this->id, $args, $taxonomies, $columns, $column_value_function);
  47. /* Set default posts if none are present */
  48. $this->post_type->set_default_posts('pagelines_default_features');
  49. /*
  50. Create meta fields for the post type
  51. */
  52. $this->meta_array = array(
  53. 'feature-style' => array(
  54. 'type' => 'select',
  55. 'inputlabel' => 'Feature Text Position',
  56. 'exp' => 'Select the type of feature style you would like to be shown. E.g. show text on left, right, bottom or not at all (full width)...',
  57. 'selectvalues' => array(
  58. 'text-left' => 'Text On Left',
  59. 'text-right' => 'Text On Right',
  60. 'text-bottom' => 'Text On Bottom',
  61. 'text-none' => 'Full Width Image or Media - No Text'
  62. ),
  63. ),
  64. 'feature-background-image' => array(
  65. 'exp' => 'Upload an image for the feature background.',
  66. 'inputlabel' => 'Feature Background Image',
  67. 'type' => 'image_upload'
  68. ),
  69. 'feature-design' => array(
  70. 'type' => 'select',
  71. 'exp' => 'Select the design style you would like this feature to have (e.g. default background color, text color, overlay? etc...).',
  72. 'inputlabel' => 'Feature Design Style',
  73. 'selectvalues' => array(
  74. 'fstyle-darkbg-overlay' => 'White Text - Dark Feature Background - Transparent Text Overlay (Default)',
  75. 'fstyle-lightbg' => 'Black Text - Light Feature Background with Border - No Overlay',
  76. 'fstyle-darkbg' => 'White Text - Dark Feature Background - No Overlay',
  77. 'fstyle-nobg' => 'Black Text - No Feature Background - No Overlay',
  78. ),
  79. ),
  80. 'feature-media-image' => array(
  81. 'version' => 'pro',
  82. 'type' => 'image_upload',
  83. 'inputlabel' => 'Feature Media Image',
  84. 'exp' => 'Upload an image of the appropriate size for the feature media area.'
  85. ),
  86. 'feature-media' => array(
  87. 'version' => 'pro',
  88. 'type' => 'textarea',
  89. 'inputlabel' => 'Feature Media HTML (Youtube, Flash etc...)',
  90. 'exp' => 'Feature Page Media HTML or Embed Code.'
  91. ),
  92. 'feature-thumb' => array(
  93. 'exp' => 'Add thumbnails to your post for use in thumb navigation. Create an image 50px wide by 30px tall and upload here.',
  94. 'inputlabel' => 'Feature Thumb (50px by 30px)',
  95. 'type' => 'image_upload'
  96. ),
  97. 'feature-link-url' => array(
  98. 'exp' => 'Adding a URL here will add a link to your feature slide',
  99. 'inputlabel' => 'Feature Link URL',
  100. 'type' => 'text'
  101. ),
  102. 'feature-link-text' => array(
  103. 'default' => 'More',
  104. 'exp' => 'Enter the text you would like in your feature link',
  105. 'inputlabel' => 'Link Text',
  106. 'type' => 'text'
  107. ),
  108. 'feature-name' => array(
  109. 'default' => '',
  110. 'exp' => 'Enter the title you would like to appear when the feature nav mode is set to feature names',
  111. 'inputlabel' => 'Navigation Label',
  112. 'type' => 'text'
  113. ),
  114. );
  115. if(pagelines('feature_source') == 'posts'){
  116. $post_types = array($this->id, 'post');
  117. } else { $post_types = array($this->id); }
  118. $this->meta_settings = array(
  119. 'id' => 'feature-meta',
  120. 'name' => THEMENAME." Feature Options",
  121. 'posttype' => $post_types
  122. );
  123. $this->meta_options = new PageLinesMetaOptions($this->meta_array, $this->meta_settings);
  124. /*
  125. Create meta fields for the page template when using the Feature Template
  126. */
  127. $meta_array = array(
  128. 'feature_items' => array(
  129. 'version' => 'pro',
  130. 'type' => 'text',
  131. 'inputlabel' => 'Number of Feature Slides',
  132. 'exp' => 'Enter the max number of feature slides to show on this page. Note: If left blank, the number of posts selected under reading settings in the admin will be used.'
  133. ),
  134. 'feature_set' => array(
  135. 'version' => 'pro',
  136. 'type' => 'select_taxonomy',
  137. 'taxonomy_id' => "feature-sets",
  138. 'inputlabel' => 'Select Feature Set To Show',
  139. 'exp' => 'If you are using the feature section, select the feature set you would like to show on this page.'
  140. )
  141. );
  142. $meta_settings = array(
  143. 'id' => 'feature-template-meta',
  144. 'name' => THEMENAME." Feature Section Options",
  145. 'posttype' => 'page'
  146. );
  147. $this->meta_options = new PageLinesMetaOptions($meta_array, $meta_settings);
  148. }
  149. function section_head() {
  150. // Get the features from post type
  151. $feature_posts = $this->get_feature_posts();
  152. ?><script type="text/javascript">
  153. /* <![CDATA[ */
  154. var $j = jQuery.noConflict();
  155. $j(document).ready(function () {
  156. //Feature Cycle Setup
  157. $j('#cycle').cycle({
  158. fx: '<?php if(pagelines('feffect')):?><?php echo pagelines('feffect');?><?php else:?>fade<?php endif;?>',
  159. sync: <?php if(pagelines('fremovesync')):?>0<?php else:?>1<?php endif;?>,
  160. timeout: <?php if(pagelines('timeout')):?><?php echo pagelines('timeout');?><?php else:?>0<?php endif;?>,
  161. speed: <?php if(pagelines('fspeed')):?><?php echo pagelines('fspeed');?><?php else:?>1500<?php endif;?>,
  162. cleartype:true,
  163. cleartypeNoBg:true,
  164. pager: 'div#featurenav'
  165. });<?php
  166. if(pagelines('feature_nav_type') == 'names'):?>
  167. //Overide page numbers on cycle feature with custom text
  168. $j("div#featurenav").children("a").each(function() {
  169. <?php $count = 1;?>
  170. <?php foreach($feature_posts as $feature_post => $feature_info):?>
  171. if($j(this).html() == "<?php echo $count;?>") { if($j(this).html("<?php
  172. if(get_post_meta($feature_info->ID,'feature-name',true)){
  173. echo get_post_meta($feature_info->ID,'feature-name',true);
  174. } else echo 'feature ' . $count;
  175. ?>"));}
  176. <?php $count++; endforeach;?>
  177. });
  178. <?php elseif(pagelines('feature_nav_type') == 'thumbs'):?>
  179. //Overide page numbers on cycle feature with custom text
  180. $j("div#featurenav").children("a").each(function() {
  181. <?php $count = 1;?>
  182. <?php foreach($feature_posts as $feature_post => $feature_info):?>
  183. if($j(this).html() == "<?php echo $count;?>") {
  184. $j(this).html('<span class="nav_thumb" style="background:#fff url(<?php echo get_post_meta( $feature_info->ID, "feature-thumb", true); ?>)"><span class="nav_overlay">&nbsp;</span></span>');}
  185. <?php $count += 1;?>
  186. <?php endforeach;?>
  187. });
  188. <?php elseif(pagelines('feature_nav_type') == 'arrows'):?>
  189. //Overide page numbers on cycle feature with arrows
  190. $j(function() {
  191. $j('#arrownav a span').each(function() {
  192. eval($j(this).text());
  193. });
  194. });
  195. <?php endif;
  196. if(pagelines('feature_playpause')):?>
  197. // Play Pause
  198. $j('.playpause').click(function() {
  199. if ($j(this).hasClass('pause')) {
  200. $j('#cycle').cycle('pause');
  201. $j(this).removeClass('pause').addClass('resume');
  202. } else {
  203. $j(this).removeClass('resume').addClass('pause');
  204. $j('#cycle').cycle('resume');
  205. }
  206. });
  207. <?php endif;?>
  208. });
  209. /* ]]> */
  210. </script>
  211. <?php }
  212. function section_template() {
  213. ?>
  214. <div id="feature_slider" class="fix">
  215. <div id="feature-area">
  216. <div id="cycle">
  217. <?php
  218. global $post;
  219. global $pagelines_layout;
  220. $current_page_post = $post;
  221. $feature_posts = $this->get_feature_posts();
  222. if(!empty($feature_posts) && is_array($feature_posts)):
  223. foreach($feature_posts as $post) :
  224. // Setup For Std WP functions
  225. setup_postdata($post);
  226. // Get Feature Style
  227. if(get_post_meta($post->ID, 'feature-style', true)) $feature_style = get_post_meta($post->ID, 'feature-style', true);
  228. else $feature_style = 'text-left';
  229. if(get_post_meta($post->ID, 'feature-link-text', true)) {
  230. $flink_text = get_post_meta($post->ID, 'feature-link-text', true);
  231. }else $flink_text = __('More', 'pagelines');
  232. //Get the Thumbnail URL
  233. $feature_background_image = get_post_meta($post->ID, 'feature-background-image', true);
  234. $feature_design = (get_post_meta($post->ID, 'feature-design', true)) ? get_post_meta($post->ID, 'feature-design', true) : '';
  235. ?>
  236. <div id="<?php echo 'feature_'.$post->ID;?>" class="fcontainer <?php echo $feature_style.' '.$feature_design; ?> fix" >
  237. <div class="feature-wrap wcontent" <?php if($feature_background_image):?>style="background: url('<?php echo $feature_background_image;?>') no-repeat top center" <?php endif;?>>
  238. <div class="feature-pad fix">
  239. <?php pagelines_register_hook( 'pagelines_feature_before', $this->id ); // Hook ?>
  240. <div class="fcontent <?php if(get_post_meta($post->ID, 'fcontent-bg', true)) echo get_post_meta($post->ID, 'fcontent-bg', true);?>">
  241. <div class="dcol-pad fix">
  242. <?php pagelines_register_hook( 'pagelines_fcontent_before', $this->id );?>
  243. <div class="fheading">
  244. <h2 class="ftitle"><?php the_title(); ?></h2>
  245. </div>
  246. <div class="ftext">
  247. <?php pagelines_register_hook( 'pagelines_feature_text_top', $this->id ); // Hook ?>
  248. <div class="fexcerpt">
  249. <?php
  250. if(pagelines_option('feature_source') == 'posts') the_excerpt();
  251. else the_content();
  252. ?>
  253. </div>
  254. <?php if(get_post_meta($post->ID, 'feature-link-url', true)):?>
  255. <a class="flink" href="<?php echo get_post_meta($post->ID, 'feature-link-url', true);?>"><span class="featurelink" ><?php echo $flink_text;?></span></a>
  256. <?php endif;?>
  257. <?php pagelines_register_hook( 'pagelines_feature_text_bottom', $this->id ); // Hook ?>
  258. <?php edit_post_link(__('<span>Edit</span>', 'pagelines'), '', '');?>
  259. </div>
  260. <?php pagelines_register_hook( 'pagelines_fcontent_after', $this->id );?>
  261. </div>
  262. </div>
  263. <div class="fmedia" style="">
  264. <div class="dcol-pad">
  265. <?php pagelines_register_hook( 'pagelines_feature_media_top', $this->id ); // Hook ?>
  266. <?php if(get_post_meta($post->ID, 'feature-media-image', true)):?>
  267. <div class="media-frame">
  268. <img src="<?php echo get_post_meta( $post->ID, 'feature-media-image', true);?>" />
  269. </div>
  270. <?php elseif(get_post_meta( $post->ID, 'feature-media', true)): ?>
  271. <?php echo get_post_meta( $post->ID, 'feature-media', true); ?>
  272. <?php endif;?>
  273. </div>
  274. </div>
  275. <?php pagelines_register_hook( 'pagelines_feature_after', $this->id );?>
  276. <div class="clear"></div>
  277. </div>
  278. </div>
  279. </div>
  280. <?php endforeach; ?>
  281. <?php else: ?>
  282. <h4 style="padding: 50px; text-align: center"><?php _e('No feature posts matched this pages criteria', 'pagelines');?></h4>
  283. <?php endif;?>
  284. <?php $post = $current_page_post;?>
  285. </div>
  286. <?php if(pagelines('feature_nav_type') == 'arrows'):?>
  287. <div id="arrownav">
  288. <a href="#"><span id="prev">&nbsp;</span></a>
  289. <a href="#"><span id="next">&nbsp;</span></a>
  290. </div>
  291. <?php endif;?>
  292. </div>
  293. <div id="feature-footer" class="<?php e_pagelines('feature_nav_type', '');?> <?php if( count($this->the_feature_posts) == 1) echo 'nonav';?> fix">
  294. <div class="feature-footer-pad">
  295. <?php pagelines_register_hook( 'pagelines_feature_nav_before', $this->id );?>
  296. <?php if(pagelines('timeout') != 0 && pagelines('feature_playpause')):?><span class="playpause pause"><span>&nbsp;</span></span><?php endif;?>
  297. <div id="featurenav" class="fix">
  298. </div>
  299. <div class="clear"></div>
  300. </div>
  301. </div>
  302. </div>
  303. <div class="clear"></div>
  304. <?php }
  305. function get_feature_posts(){
  306. global $post;
  307. global $pagelines_ID;
  308. if(!isset($this->the_feature_posts)){
  309. if(pagelines_option('feature_source') == 'posts'){
  310. $query_args = array('post_type' => 'post', 'orderby' =>'ID');
  311. if(pagelines_option('feature_category')){
  312. $query_args = array_merge($query_args, array( 'cat' => pagelines('feature_category') ) );
  313. }
  314. } else {
  315. $query_args = array('post_type' => $this->id, 'orderby' =>'ID');
  316. if( get_pagelines_meta('feature_set', $pagelines_ID) ){
  317. $query_args = array_merge($query_args, array( 'feature-sets' => get_post_meta($pagelines_ID, 'feature_set', true) ) );
  318. } elseif (pagelines_non_meta_data_page() && pagelines_option('feature_default_tax')){
  319. $query_args = array_merge($query_args, array( 'feature-sets' => pagelines_option('feature_default_tax') ) );
  320. }
  321. }
  322. if(pagelines('feature_items', $pagelines_ID)){
  323. $query_args = array_merge($query_args, array( 'showposts' => pagelines_option('feature_items', $pagelines_ID) ) );
  324. }
  325. $feature_query = new WP_Query($query_args);
  326. $this->the_feature_posts = $feature_query->posts;
  327. return $this->the_feature_posts;
  328. } else {
  329. return $this->the_feature_posts;
  330. }
  331. }
  332. function section_scripts() {
  333. return array(
  334. 'cycle' => array(
  335. 'file' => $this->base_url . '/jquery.cycle.js',
  336. 'dependancy' => array('jquery'),
  337. 'location' => 'footer',
  338. 'version' => '2.86'
  339. )
  340. );
  341. }
  342. function section_options($optionset = null, $location = null) {
  343. if($optionset == 'new' && $location == 'bottom'){
  344. return array(
  345. 'feature_settings' => array(
  346. 'feature_nav_type' => array(
  347. 'default' => "thumbs",
  348. 'version' => 'pro',
  349. 'type' => 'radio',
  350. 'selectvalues' => array(
  351. 'nonav' => 'No Navigation',
  352. 'dots' => 'Squares or Dots',
  353. 'names' => 'Feature Names',
  354. 'thumbs' => 'Feature Thumbs (50px by 30px)',
  355. 'numbers'=>'Numbers',
  356. ),
  357. 'inputlabel' => 'Feature navigation type?',
  358. 'title' => 'Feature Navigation Mode',
  359. 'shortexp' => "Select the mode for your feature navigation",
  360. 'exp' => "Select from the three modes. Using feature names will use the names of the features, using the numbers will use incremental numbers, thumbnails will use feature thumbnails if provided."
  361. ),
  362. 'timeout' => array(
  363. 'default' => 0,
  364. 'version' => 'pro',
  365. 'type' => 'text_small',
  366. 'inputlabel' => 'Timeout (ms)',
  367. 'title' => 'Feature Viewing Time (Timeout)',
  368. 'shortexp' => 'The amount of time a feature is set before it transitions in milliseconds',
  369. 'exp' => 'Set this to 0 to only transition on manual navigation. Use milliseconds, for example 10000 equals 10 seconds of timeout.'
  370. ),
  371. 'fspeed' => array(
  372. 'default' => 1500,
  373. 'version' => 'pro',
  374. 'type' => 'text_small',
  375. 'inputlabel' => 'Transition Speed (ms)',
  376. 'title' => 'Feature Transition Time (Timeout)',
  377. 'shortexp' => 'The time it takes for your features to transition in milliseconds',
  378. 'exp' => 'Use milliseconds, for example 1500 equals 1.5 seconds of transition time.'
  379. ),
  380. 'feffect' => array(
  381. 'default' => 'fade',
  382. 'version' => 'pro',
  383. 'type' => 'select_same',
  384. 'selectvalues' => array('blindX','blindY','blindZ', 'cover','curtainX','curtainY','fade','fadeZoom','growX','growY','none','scrollUp','scrollDown','scrollLeft','scrollRight','scrollHorz','scrollVert','shuffle','slideX','slideY','toss','turnUp','turnDown','turnLeft','turnRight','uncover','wipe','zoom'),
  385. 'inputlabel' => 'Select Transition Effect',
  386. 'title' => 'Transition Effect',
  387. 'shortexp' => "How the features transition",
  388. 'exp' => "This controls the mode with which the features transition to one another."
  389. ),
  390. 'feature_playpause' => array(
  391. 'default' => false,
  392. 'version' => 'pro',
  393. 'type' => 'check',
  394. 'inputlabel' => 'Show play pause button?',
  395. 'title' => 'Show Play/Pause Button (when timeout is greater than 0 (auto-transition))',
  396. 'shortexp' => "Show a play/pause button for auto-scrolling features",
  397. 'exp' => "Selecting this option will add a play/pause button for auto-scrolling features, that users can use to pause and watch a video, read a feature, etc.."
  398. ),
  399. 'feature_items' => array(
  400. 'default' => 10,
  401. 'version' => 'pro',
  402. 'type' => 'text_small',
  403. 'inputlabel' => 'Number of Features To Show',
  404. 'title' => 'Number of Features',
  405. 'shortexp' => "Limit the number of features that are shown",
  406. 'exp' => "Use this option to limit the number of features shown."
  407. ),
  408. 'feature_source' => array(
  409. 'default' => 'featureposts',
  410. 'version' => 'pro',
  411. 'type' => 'select',
  412. 'selectvalues' => array(
  413. 'featureposts' => array("name" => 'Feature Posts (custom post type)'),
  414. 'posts' => array("name" => 'Use Post Category'),
  415. ),
  416. 'inputlabel' => 'Select source',
  417. 'title' => 'Feature Post Source',
  418. 'shortexp' => "Use feature posts or a post category",
  419. 'exp' => "By default the feature section will use feature posts, you can also set the source for features to a blog post category. Set the category ID in its option below. <br/> <strong>NOTE: If set to posts, excerpts will be used as content (control length through them). Also a new option panel will be added on post creation and editing pages.</strong>"
  420. ),
  421. 'feature_category' => array(
  422. 'default' => false,
  423. 'version' => 'pro',
  424. 'type' => 'text_small',
  425. 'inputlabel' => 'Post category ID',
  426. 'title' => 'Post Category ID (Blog Post Mode Only)',
  427. 'shortexp' => "Add the category ID to use if sourcing features from blog posts",
  428. 'exp' => "Get the ID for the category to use posts from for features"
  429. ),
  430. 'feature_default_tax' => array(
  431. 'default' => 'default-features',
  432. 'version' => 'pro',
  433. 'taxonomy_id' => 'feature-sets',
  434. 'type' => 'select_taxonomy',
  435. 'inputlabel' => 'Select Posts/404 Feature-Set',
  436. 'title' => 'Select Feature-Set for Posts & 404 Pages',
  437. 'shortexp' => "Posts pages and similar pages (404) Will Use This set ID To Source Features",
  438. 'exp' => "Posts pages and 404 pages in WordPress don't support meta data so you need to assign a set here. (If you want to use 'features' on these pages.)",
  439. ),
  440. 'feature_stage_height' => array(
  441. 'default' => '330',
  442. 'version' => 'pro',
  443. 'type' => 'css_option',
  444. 'selectors' => '#feature-area, .feature-wrap, #feature_slider .fmedia, #feature_slider .fcontent, #feature_slider .text-bottom .fmedia .dcol-pad, #feature_slider .text-bottom .feature-pad, #feature_slider .text-none .fmedia .dcol-pad',
  445. 'css_prop' => 'height',
  446. 'css_units' => 'px',
  447. 'inputlabel' => 'Enter the height (In Pixels) of the Feature Stage Area',
  448. 'title' => 'Feature Area Height',
  449. 'shortexp' => "Use this feature to change the height of your feature area",
  450. 'exp' => "To change the height of your feature area, just enter a number in pixels here.",
  451. ),
  452. 'fremovesync' => array(
  453. 'default' => false,
  454. 'type' => 'check',
  455. 'version' => 'pro',
  456. 'inputlabel' => 'Remove Transition Syncing',
  457. 'title' => 'Remove Feature Transition Syncing',
  458. 'shortexp' => "Make features wait to move on until after the previous one has cleared the screen",
  459. 'exp' => "This controls whether features can move on to the screen while another is transitioning off. If removed features will have to leave the screen before the next can transition on to it."
  460. )
  461. )
  462. );
  463. }
  464. }
  465. // End of Section Class //
  466. }
  467. function feature_column_display($column){
  468. global $post;
  469. switch ($column){
  470. case "feature-description":
  471. the_excerpt();
  472. break;
  473. case "feature-media":
  474. if(m_pagelines('feature-media', $post->ID)){
  475. em_pagelines('feature-media', $post->ID);
  476. }elseif(m_pagelines('feature-media-image', $post->ID)){
  477. echo '<img src="'.m_pagelines('feature-media', $post->ID).'" style="max-width: 200px; max-height: 200px" />';
  478. }elseif(m_pagelines('feature-background-image', $post->ID)){
  479. echo '<img src="'.m_pagelines('feature-background-image', $post->ID).'" style="max-width: 200px; max-height: 200px" />';
  480. }
  481. break;
  482. case "feature-sets":
  483. echo get_the_term_list($post->ID, 'feature-sets', '', ', ','');
  484. break;
  485. }
  486. }
  487. function pagelines_default_features(){
  488. $default_features = array_reverse(get_default_features());
  489. foreach($default_features as $feature){
  490. // Create post object
  491. $default_post = array();
  492. $default_post['post_title'] = $feature['title'];
  493. $default_post['post_content'] = $feature['text'];
  494. $default_post['post_type'] = 'feature';
  495. $default_post['post_status'] = 'publish';
  496. $newPostID = wp_insert_post( $default_post );
  497. update_post_meta($newPostID, 'feature-thumb', $feature['thumb']);
  498. update_post_meta($newPostID, 'feature-link-url', $feature['link']);
  499. update_post_meta($newPostID, 'feature-style', $feature['style']);
  500. update_post_meta($newPostID, 'feature-media', $feature['media']);
  501. update_post_meta($newPostID, 'feature-background-image', $feature['background']);
  502. update_post_meta($newPostID, 'feature-design', $feature['fcontent-design']);
  503. wp_set_object_terms($newPostID, 'default-features', 'feature-sets');
  504. }
  505. }