Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Last active July 2, 2025 16:18
Show Gist options
  • Select an option

  • Save jdevalk/5459982 to your computer and use it in GitHub Desktop.

Select an option

Save jdevalk/5459982 to your computer and use it in GitHub Desktop.

Revisions

  1. Joost de Valk revised this gist Apr 3, 2014. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  2. Joost de Valk revised this gist Apr 3, 2014. 2 changed files with 11 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,9 @@
    <?php
    function fix_content_input( $content, $vid ) {
    $post = get_post( $vid['post_id'] );
    if ( !empty( $post->post_excerpt ) )
    if ( !empty( $post->post_excerpt ) ) {
    $content = "\n" . 'http://youtube.com/v/'. $post->post_excerpt . "\n" . $content;
    }
    return $content;
    }
    add_filter( 'wpseo_video_index_content', 'fix_content_input', 10, 2 );
    9 changes: 9 additions & 0 deletions gistfile2.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <?php
    function fix_content_input( $content, $vid ) {
    $post_meta = get_post_meta( $vid['post_id'], 'youtube', true );
    if ( !empty( $post_meta ) ) {
    $content = "\n" . 'http://youtube.com/v/'. $post_meta . "\n" . $content;
    }
    return $content;
    }
    add_filter( 'wpseo_video_index_content', 'fix_content_input', 10, 2 );
  3. Joost de Valk renamed this gist Apr 25, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. Joost de Valk created this gist Apr 25, 2013.
    8 changes: 8 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    <?php
    function fix_content_input( $content, $vid ) {
    $post = get_post( $vid['post_id'] );
    if ( !empty( $post->post_excerpt ) )
    $content = "\n" . 'http://youtube.com/v/'. $post->post_excerpt . "\n" . $content;
    return $content;
    }
    add_filter( 'wpseo_video_index_content', 'fix_content_input', 10, 2 );