Example #1
0
/**
 * Triggers post procceses.
 */
function wpcf_admin_post_page_load_hook()
{
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php';
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields-post.php';
    // Get post
    if (isset($_GET['post'])) {
        $post_id = (int) $_GET['post'];
    } else {
        if (isset($_POST['post_ID'])) {
            $post_id = (int) $_POST['post_ID'];
        } else {
            $post_id = 0;
        }
    }
    // Init processes
    if ($post_id) {
        $post = get_post($post_id);
        if (!empty($post)) {
            wpcf_admin_post_init($post);
        }
    } else {
        wpcf_admin_post_init();
    }
}
Example #2
0
/**
 * Triggers post procceses.
 */
function wpcf_admin_edit_screen_load_hook()
{
    require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields-post.php';
    global $wpcf;
    $wpcf->post = wpcf_admin_get_edited_post();
    wpcf_admin_post_init($wpcf->post);
}