Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugins can operate on different aspects of custom fields. Exactly what are you trying to do?

    Thread Starter minghags

    (@minghags)

    I have (www.sarkotv.net) there where is video is embed code used in Custom Field. Now I want to change this embed code that I can use ProPlayer example in Custom Fields: [proplayer]youtubelink[/proplayer] But now instead of running video just writes this [proplayer]youtubelink[/proplayer]. I think Plugins cannot be used in Custom Fields without another plugin that links to them.

    Thanks

    It sounds like ProPlayer is just filtering the_content for it’s own tags and then replacing them with embed code, that’s why it’s not working on your custom fields.

    If there is a single function inside the ProPlayer that does this you might be able to to pass your custom fields through it: pro_player($custom_field)

    If there is a single function inside the ProPlayer that does this…

    Lol… I was just looking into that. ProPlayer uses addPlayerCode to parse the quicktag so I think that passing the custom filed value through $proPlayer->addPlayerCode($fieldvalue) will do it.

    Thread Starter minghags

    (@minghags)

    i added to my proplayer.php line $proPlayer->addPlayerCode($fieldvalue);

    And still no luck, can anyone explain if im doing right thing?

    Thanks

    You’ll need to echo the statement. The function returns a value but doesn’t display it. You also need to set $fieldvalue. As is, its an empty value– a placeholder.

    Thread Starter minghags

    (@minghags)

    Can you help me do that please? I don’t exactly know how to do that.

    Thanks

    I need to see the PHP of the page where you are trying to display the information. Maybe use the WordPress pastebin.

    Thread Starter minghags

    (@minghags)

    I can give u access to the wordpress stuff, if you give me MSN or Skype.

    Thanks

    Thread Starter minghags

    (@minghags)

    or email it to me on [email protected]

    Thanks again

    Thread Starter minghags

    (@minghags)

    if not, Here is code of single video page.

    Instead of this:

    echo get_post_meta($post->ID, $key, true);

    What I think you want is this:

    $fieldvalue = get_post_meta($post->ID, $key, true);
    echo $proPlayer->addPlayerCode($fieldvalue);

    You can often combine the two lines like so, if you want:

    echo $proPlayer->addPlayerCode(get_post_meta($post->ID, $key, true));

    To be safe you’d wrap the whole thing in an if/else like so:

    if ($proPlayer) {
    echo $proPlayer->addPlayerCode(get_post_meta($post->ID, $key, true));
    }

    Debugging will be easier without the if part, though, since you’ll get an error if it doesn’t exist. Then you’ll know I’ve got the name wrong, or the plugin isn’t loading, or something.

    Also please bear in mind that I’m guessing. Looking at the code it looks to me like this should work, but I haven’t tested it.

    Thread Starter minghags

    (@minghags)

    It works like a charm with if function you are a life saver apljdi ??

    Thanks again

    Thread Starter minghags

    (@minghags)

    Just one more thing if anyone knows it. I want to use Permalinks without any extension on Lighttpd. (example /video/%postname%/) And when I configure WordPress that way, and add “^/([^.?]*)\?(.*)$” => “/index.php?q=$1&$2”, into my lighttpd.conf it just redirect me to main page again and again

    Thanks again

    Hey guys, sorry to bring this thread back up, but I’m trying to accomplish the same thing as the OP.

    Really my only question at this point is where do I paste this code (which file):

    if ($proPlayer) {
    echo $proPlayer->addPlayerCode(get_post_meta($post->ID, $key, true));
    }

    Thanks guys!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Enable plugin support in Custom Fields’ is closed to new replies.