WordPress.org

Ready to get started?Download WordPress

Forums

How to Return Title, Excerpt for Use in PHP (1 post)

  1. onenationunderdog
    Member
    Posted 8 years ago #

    hey--

    first of all, apologies b/c i don't know scripting and am just mucking about.

    i'm hacking a plugin (sid's mp3 player) that prints a flash audio player if an mp3 is used in a custom field.

    i've successfully changed it so that a javascript link is printed to call the player in a popup window. inside the javascript link (onclick) is contained the mp3 path value, which is passed on to the .js script that builds the player.

    i'd to also include other values in the onclick, namely the post title and excerpt -- but stripped of any entities (like apostrophes) that would break the javascript.

    to do so it seems that i need to declare a $variable in the plugin file and define it as the_excerpt_rss (example), but without echoing the contents... or else it shows up in the post and is not passed on to javascript.

    the most success i've had is using the get_the_excerpt function (found here: http://codex.wordpress.org/Talk:Template_tags/the_excerpt), but it did not filter (as indicated on above page) the results and so some excerpts broke the javascript.

    after scouring the codex, forums and the contents of other plugins i'm guessing this would be obvious to someone w/ basic php knowledge.

    anyone have any suggestions? i could post the plugin/javascript code if that would help...

    btw, i found this thread... whatever became of this idea of extending get_ functions to everything/most things?
    http://wordpress.org/pipermail/hackers/2004-November/thread.html#2723

Topic Closed

This topic has been closed to new replies.

About this Topic