Пример #1
0
/**
 * Implements hook_node_insert().
 * When a node is created, notify CM to scrape its details
 * and clear FB cache
 *
 * @param $node The node that has been created
 */
function shareaholic_node_insert($node)
{
    ShareaholicContentSettings::insert($node);
    ShareaholicContentManager::single_page_worker($node);
    ShareaholicUtilities::clear_fb_opengraph($node);
}
Пример #2
0
 /**
  * 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);
     }
 }