WordPress.org

Support

Support » Plugins and Hacks » Featured Video Plus » [Resolved] Hook into admin area?

[Resolved] Hook into admin area?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Nevermind. It’s late and I wasn’t thinking about what my functions.php file could/couldn’t reference. For anyone with the same prob, just add this to your functions.php file:

    function has_post_video($post_id = null){

    global $post;

    if($post_id == null)
    $post_id = $GLOBALS[‘post’]->ID;

    $meta = unserialize( get_post_meta( $post_id, ‘_fvp_video’, true ) );

    if( !isset($meta) || empty($meta[‘id’]) )
    return false;

    return true;

    }

    It seems the other functions should work similarly well.

    Thank you very much for this plugin, sir. 5 stars!

    Sorry, one last thing. In the above code you will want to suffix any function re-used on the admin side so it isn’t re-declared. Ex.

    function has_post_video_admin($post_id = null){

    global $post;

    if($post_id == null)
    $post_id = $GLOBALS[‘post’]->ID;

    $meta = unserialize( get_post_meta( $post_id, ‘_fvp_video’, true ) );

    if( !isset($meta) || empty($meta[‘id’]) )
    return false;

    return true;

    }

    Plugin Author Alex

    @ahoereth

    You did the right thing, the has_post_video-function is just available on the front end. Did not think about someone wanting to embed the plugin more deeply into the WordPress Admin interface. But you are right, maybe I should open it up for front- & backend. I will consider this for the next version, thanks!

    If someone uses the approach described above, please use a suffix or prefix as described in #3. This way the function won’t get in conflict with a feature release.

    PS: Thanks for the rating!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Hook into admin area?’ is closed to new replies.
Skip to toolbar