コード例 #1
0
ファイル: utilities.php プロジェクト: swc-dng/swcsandbox
 /**
  * Call the content manager for a post before it is updated
  *
  * We do this because a user may change their permalink
  * and so we tell CM that the old permalink is not longer valid
  *
  */
 public static function before_post_is_updated($post_id)
 {
     ShareaholicUtilities::notify_content_manager_singlepage(get_post($post_id));
 }
コード例 #2
0
ファイル: utilities.php プロジェクト: antoninab/t2c
 /**
  * A post just transitioned state. Do something.
  *
  */
 public static function post_transitioned($new_status, $old_status, $post)
 {
     $post_type = get_post_type($post);
     if ($new_status == 'publish' && $post_type != 'nav_menu_item' && $post_type != 'attachment') {
         // Post was just published
         ShareaholicUtilities::clear_fb_opengraph(get_permalink($post->ID));
         ShareaholicUtilities::notify_content_manager_singlepage($post);
     }
     if ($old_status == 'publish' && $new_status != 'publish') {
         // Notify CM that the post is no longer public
         ShareaholicUtilities::notify_content_manager_singlepage($post);
     }
 }