/**
  * Renderer for the Metabox.
  */
 public static function force_submit()
 {
     check_ajax_referer('instant-articles-force-submit', 'security');
     $post_id = intval($_POST['post_ID']);
     $force = sanitize_text_field($_POST['force']) === 'true';
     update_post_meta($post_id, Instant_Articles_Publisher::FORCE_SUBMIT_KEY, $force);
     Instant_Articles_Publisher::submit_article($post_id, get_post($post_id));
 }
        wp_enqueue_script('instant-articles-settings');
        wp_enqueue_script('instant-articles-wizard');
    }
    add_action('admin_enqueue_scripts', 'instant_articles_enqueue_scripts');
    /**
     * Automatically add meta tag for Instant Articles URL claiming
     * when page is set.
     *
     * @since 0.4
     */
    function inject_url_claiming_meta_tag()
    {
        $publishing_settings = Instant_Articles_Option_Publishing::get_option_decoded();
        $fb_page_settings = Instant_Articles_Option_FB_Page::get_option_decoded();
        if (isset($fb_page_settings['page_id'])) {
            ?>
			<meta property="fb:pages" content="<?php 
            echo esc_attr($fb_page_settings['page_id']);
            ?>
" />
			<?php 
        }
    }
    add_action('wp_head', 'inject_url_claiming_meta_tag');
    // Initialize the Instant Articles meta box.
    Instant_Articles_Meta_Box::init();
    // Initialize the Instant Articles publisher.
    Instant_Articles_Publisher::init();
    // Initialize the Instant Articles Wizard page.
    Instant_Articles_Wizard::init();
}
 /**
  * Submits the select page for review
  */
 public static function submit_for_review()
 {
     if (!current_user_can('manage_options')) {
         wp_die(esc_html('You do not have sufficient permissions to access this page.'));
     }
     $current_state = Instant_Articles_Wizard_State::get_current_state();
     if ($current_state !== Instant_Articles_Wizard_State::STATE_REVIEW_SUBMISSION) {
         die;
     }
     $fb_app_settings = Instant_Articles_Option_FB_App::get_option_decoded();
     $fb_page_settings = Instant_Articles_Option_FB_Page::get_option_decoded();
     $client = Client::create($fb_app_settings['app_id'], $fb_app_settings['app_secret'], $fb_page_settings['page_access_token'], $fb_page_settings['page_id']);
     try {
         // Bulk upload articles for review
         $articles_for_review = Instant_Articles_Wizard_Review_Submission::getArticlesForReview();
         foreach ($articles_for_review as $post) {
             Instant_Articles_Publisher::submit_article($post->ID, $post);
         }
         // Trigger review submission
         $client->submitForReview();
     } catch (Exception $e) {
         // If something went wrong, simply render the error + the same state.
         echo '<div class="error settings-error notice is-dismissible"><p><strong>' . esc_html($e->getMessage()) . '</strong></p></div>';
     }
     self::render(true);
     die;
 }