Changeset 1174425
- Timestamp:
- 06/04/2015 12:49:14 PM (11 years ago)
- Location:
- lti-sitemap/trunk/src
- Files:
-
- 2 edited
-
admin/admin.php (modified) (2 diffs)
-
lti-sitemap.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lti-sitemap/trunk/src/admin/admin.php
r1174335 r1174425 261 261 */ 262 262 public function add_meta_boxes() { 263 if ( $this->settings->get( 'content_news_support' ) == true ) { 264 $supported_post_types = $this->get_supported_post_types(); 265 foreach ( $supported_post_types as $supported_post_type ) { 266 add_meta_box( 267 'lti-sitemap-metadata-box', 268 lsmint( 'admin.meta_box' ), 269 array( $this, 'metadata_box' ), 270 $supported_post_type, 271 'advanced', 272 'high' 273 ); 274 } 263 $supported_post_types = $this->get_supported_post_types(); 264 foreach ( $supported_post_types as $supported_post_type ) { 265 add_meta_box( 266 'lti-sitemap-metadata-box', 267 lsmint( 'admin.meta_box' ), 268 array( $this, 'metadata_box' ), 269 $supported_post_type, 270 'advanced', 271 'high' 272 ); 275 273 } 276 274 } … … 459 457 } 460 458 461 //If the post is a news item, we set a special post meta to make sitemap queries easier. 462 $post_variables = $this->helper->filter_var_array( $_POST['lti_sitemap_news'] ); 463 if ( ! is_null( $post_variables ) && ! empty( $post_variables ) && $post_variables !== false ) { 459 if ( isset( $_POST['lti_sitemap_news'] ) ) { 460 //If the post is a news item, we set a special post meta to make sitemap queries easier. 464 461 update_post_meta( $post_ID, 'lti_sitemap_post_is_news', true ); 465 462 } else { 466 delete_post_meta( $post_ID, 'lti_sitemap_post_is_news' , true);463 delete_post_meta( $post_ID, 'lti_sitemap_post_is_news' ); 467 464 } 468 465 } -
lti-sitemap/trunk/src/lti-sitemap.php
r1174335 r1174425 135 135 $this->loader->add_filter( 'plugin_action_links', $this->admin, 'plugin_action_links', 10, 2 ); 136 136 $this->loader->add_filter( 'plugin_row_meta', $this->admin, 'plugin_row_meta', 10, 2 ); 137 $this->loader->add_action( 'add_meta_boxes', $this->admin, 'add_meta_boxes' ); 138 $this->loader->add_action( 'save_post', $this->admin, 'save_post', 10, 3 ); 137 if ( $this->settings->get( 'content_news_support' ) == true ) { 138 $this->loader->add_action( 'add_meta_boxes', $this->admin, 'add_meta_boxes' ); 139 $this->loader->add_action( 'save_post', $this->admin, 'save_post', 10, 3 ); 140 } 139 141 140 142 if ( isset( $GLOBALS['pagenow'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.