GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Wordpress user of gallery function (https://gfy.com/showthread.php?t=1104893)

brassmonkey 03-31-2013 01:21 PM

Wordpress user of gallery function
 
they've removed yet another feature in 3.5.1 :disgust
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>';
}


fris 03-31-2013 03:11 PM

please dont hack core files ;)

brassmonkey 03-31-2013 03:24 PM

Quote:

Originally Posted by fris (Post 19554410)
please dont hack core files ;)

as far as i know its ok. what?? you see a problem?

fris 03-31-2013 04:11 PM

Quote:

Originally Posted by brassmonkey (Post 19554426)
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.

robwod 03-31-2013 04:36 PM

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.

robwod 03-31-2013 04:37 PM

Quote:

Originally Posted by fris (Post 19554457)
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

brassmonkey 03-31-2013 04:42 PM

Quote:

Originally Posted by robwod (Post 19554475)
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.

robwod 03-31-2013 04:45 PM

Quote:

Originally Posted by brassmonkey (Post 19554480)
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?

brassmonkey 03-31-2013 04:58 PM

Quote:

Originally Posted by robwod (Post 19554485)
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 :upsidedow

robwod 03-31-2013 05:18 PM

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

Carry on.

fris 04-01-2013 01:25 AM

if you want the old method theirs a few plugins that do it via the post screen


All times are GMT -7. The time now is 02:26 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc