Wordpress user of gallery function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brassmonkey
    Pay It Forward
    • Sep 2005
    • 77388

    #1

    Wordpress user of gallery function

    they've removed yet another feature in 3.5.1
    to get the old back let me know if you have trouble.

    file to edit: yoursite.com/wp-admin/includes/media.php

    find:
    Code:
    add_action( 'media_buttons', 'media_buttons' );
    
    function get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) {
    	global $post_ID;
    
    	if ( empty( $post_id ) )
    		$post_id = $post_ID;
    
    	$upload_iframe_src = add_query_arg( 'post_id', (int) $post_id, admin_url('media-upload.php') );
    
    	if ( $type && 'media' != $type )
    		$upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src);
    
    	if ( ! empty( $tab ) )
    		$upload_iframe_src = add_query_arg('tab', $tab, $upload_iframe_src);
    
    	$upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src);
    
    	return add_query_arg('TB_iframe', true, $upload_iframe_src);
    }
    after that add:
    Code:
    add_action('admin_head', 'remove_media_buttons');
    function remove_media_buttons(){
    remove_action('media_buttons','media_buttons');
    add_action('media_buttons', 'old_media_buttons');
    }
    
    function old_media_buttons($editor_id = 'content') {
    $context = apply_filters('media_buttons_context', __('Upload/Insert %s'));
    $img = '<img src="' . esc_url( admin_url( 'images/media-button.png?ver=20111005' ) ) . '" width="15" height="15" />';
    echo '<a href="' . esc_url( get_upload_iframe_src() ) . '" class="thickbox add_media" id="' . esc_attr( $editor_id ) . '-add_media" title="' . esc_attr__( 'Add Media' ) . '" onclick="return false;">' . sprintf( $context, $img ) . '</a>';
    }
    TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
    DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com
  • fris
    I have to go potty
    • Aug 2002
    • 55750

    #2
    please dont hack core files ;)
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


    Totally Free Templates

    Comment

    • brassmonkey
      Pay It Forward
      • Sep 2005
      • 77388

      #3
      Originally posted by fris
      please dont hack core files ;)
      as far as i know its ok. what?? you see a problem?
      TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
      DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

      Comment

      • fris
        I have to go potty
        • Aug 2002
        • 55750

        #4
        Originally posted by brassmonkey
        as far as i know its ok. what?? you see a problem?
        because when you update your changes will be lost. and you will have to do it all over again.
        Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


        Totally Free Templates

        Comment

        • robwod
          Confirmed User
          • Nov 2005
          • 2540

          #5
          The Wordpress native gallery feature is not removed from 3.5.1. We use the inline Wordpress gallery function all the time, including in 3.5.1.

          You can either upload the pics through the Media area, or click to Add Media on the post screen itself. Select all of the files you want and click the upload button. After the pics are uploaded, simply click on the ones you want and select "insert gallery".

          Unless you are talking about it being a different procedure to add a gallery than previous versions, the actually gallery function itself is still there.
          NSFW

          Comment

          • robwod
            Confirmed User
            • Nov 2005
            • 2540

            #6
            Originally posted by fris
            because when you update your changes will be lost. and you will have to do it all over again.
            Changes like that are usually better done via a custom functions file in the theme itself, so long as there is a hook for it of course.

            I seer this sort of thing a lot when people are suing the default twentyten, twentyeleven, twentytwelve themes. They'll edit those themes directly and then upgrade and lose all their edits. Many do not realize they should take advantage of the child theme functionality in wordpress when editing default themes.

            For those interested in how to do it, see this Wordpress codex page:
            http://codex.wordpress.org/Child_Themes
            Last edited by robwod; 03-31-2013, 03:40 PM.
            NSFW

            Comment

            • brassmonkey
              Pay It Forward
              • Sep 2005
              • 77388

              #7
              Originally posted by robwod
              The Wordpress native gallery feature is not removed from 3.5.1. We use the inline Wordpress gallery function all the time, including in 3.5.1.

              You can either upload the pics through the Media area, or click to Add Media on the post screen itself. Select all of the files you want and click the upload button. After the pics are uploaded, simply click on the ones you want and select "insert gallery".

              Unless you are talking about it being a different procedure to add a gallery than previous versions, the actually gallery function itself is still there.
              big difference look at both its stripped way down.
              TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
              DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

              Comment

              • robwod
                Confirmed User
                • Nov 2005
                • 2540

                #8
                Originally posted by brassmonkey
                big difference look at both its stripped way down.
                I'm not sure I see any real difference. It functions just perfect for us like it always has. If anything, it has increased the speed at which we can add galleries.

                The one thing I do dislike, however, is that when selecting to insert the gallery, it defaults to attachment page. You must first select the type to "Link to Attachment" and then specify the Columns, and then re-select "Link to Media". Beyond that, I just do not see any difference.

                Are you talking about image editing functionality?
                NSFW

                Comment

                • brassmonkey
                  Pay It Forward
                  • Sep 2005
                  • 77388

                  #9
                  Originally posted by robwod
                  I'm not sure I see any real difference. It functions just perfect for us like it always has. If anything, it has increased the speed at which we can add galleries.

                  The one thing I do dislike, however, is that when selecting to insert the gallery, it defaults to attachment page. You must first select the type to "Link to Attachment" and then specify the Columns, and then re-select "Link to Media". Beyond that, I just do not see any difference.

                  Are you talking about image editing functionality?
                  not going to talk about it just helping others add it back to classic
                  TRUMP 2026 KEKAW!!! - The Laken Riley Act Is Law!
                  DACA ENDED - SUPPORT AZ HCR 2060 52R - email: brassballz-at-techie.com

                  Comment

                  • robwod
                    Confirmed User
                    • Nov 2005
                    • 2540

                    #10
                    No problem, I was just confused when you said the gallery function was removed, when clearly it is still there.

                    Carry on.
                    NSFW

                    Comment

                    • fris
                      I have to go potty
                      • Aug 2002
                      • 55750

                      #11
                      if you want the old method theirs a few plugins that do it via the post screen
                      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


                      Totally Free Templates

                      Comment

                      Working...