Support » Plugins » How to modify P2::media_buttons

  • This is a stunning theme and have no issues so far, even on WP v3 (alpha).

    Looking into the P2 files one comes across <?php echo P2::media_buttons(); ?> in post-form.php. This calls images from within wp-admin.

    I wish to use alternative icons.

    I would really appreciate help on how P2::media_buttons(); uses parameters if any and what they may be.

    It would be a shame to have to resort to inserting a list.

Viewing 5 replies - 1 through 5 (of 5 total)
  • For me it is call up the location 2 times. So the icon links are broken.

    I have the same issue as pswheeler. The media buttons are being called twice so they are breaking. Keeps giving me this error:

    Fatal error: Cannot redeclare media_upload_tabs() (previously declared in /PATH/wp-admin/includes/media.php:18) in /PATH/wp-admin/includes/media.php on line 25

    I’ve got the same error as you guys. It’s calling up the URL twice so my icons for the media buttons aren’t loading, leaving the rather unsightly alternate text of “Add an ImageAdd VideoAdd AudioAdd Media”

    Looking at the path to the image, its calling:

    I tracked down the actual media_buttons function in p2/inc/p2.php but it’s doing some pretty gnarly things to the URL which I don’t really understand or want to change. anyone have a simple fix?

    I commented out the line:

    string = str_replace... etc

    at the bottom of the p2.php file:

    function make_media_urls_absolute( $string ) {
                    // $string = str_replace( 'images/', P2::admin_url( 'images/' ), $string );
                    // This line does not work in .org
                    return str_replace( 'media-upload.php?', P2::admin_url( 'media-upload.php?p2-upload=true&' ), $string );

    It seems to do the trick.

    ^That did it. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to modify P2::media_buttons’ is closed to new replies.