WordPress.org

Ready to get started?Download WordPress

Forums

How to modify P2::media_buttons (6 posts)

  1. gunfios
    Member
    Posted 4 years ago #

    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.

  2. pswheeler
    Member
    Posted 4 years ago #

    For me it is call up the location 2 times. So the icon links are broken.

  3. Creative Slice
    Member
    Posted 4 years ago #

    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

  4. clarklab
    Member
    Posted 4 years ago #

    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:

    http://domain.com/wp-admin/http://domain.com/wp-admin/images/media-button-image.gif

    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?

  5. Caramboo
    Member
    Posted 4 years ago #

    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.

  6. clarklab
    Member
    Posted 4 years ago #

    ^That did it. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic