Tag Info

New answers tagged

0

Try to use, image_send_to_editor . Here is the link, image_send_to_editor


0

Can you provide a link to your site and a little more explanation on what you are trying to achieve? Here's a shot in the dark guess. Archives shows content of type 'post', but you can alter it to include custom post types. Add this filter to your functions.php file: function namespace_add_custom_types( $query ) { if( is_category() || is_tag() && ...


1

WordPress Walkers aren't using constructors. They are started up with walk() method which is passed arguments as third argument (confusingly not reflected in method signature). You can capture it into your object's property with something like this: class Args_Walker extends Walker { public function walk( $elements, $max_depth ) { // we could ...


-2

I thing, you should use this code for filter the check box category <?php // cat 42=Laos cat 57=2-4Days <?php $my_query_1 = new WP_query(array('category__and' => array(42,57))); ?> <?php while ($my_query_1->have_posts()) : $my_query_1->the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark" ...


1

When you use wp_list_categories() you get a list of terms, each one linked to its archive page. I think what you need is a form to filter the products, not a list of archive term links, so you can keep the selected filters between requests, for example, using $_POST, $_SESSION or $_COOKIES. Example using $_POST: <?php //taxonomies you want to filter ...


0

I found a solution; use pre_get_posts: add_action( 'pre_get_posts', 'modify_attachments' ); function modify_attachments( $query ) { if ( is_admin() && strpos( $_SERVER[ 'REQUEST_URI' ], 'admin-ajax.php' ) !== false ) { add_filter( 'posts_groupby', 'group_attachments' ); } return $query; } function group_attachments( $groupby ...


0

Use filter content_save_pre exactly like the_content -- the difference is that it operates when a post is saved, rather than displayed. http://codex.wordpress.org/Plugin_API/Filter_Reference/content_save_pre


-1

You could try this: function restricted_access() { if( ! is_user_logged_in() ) { global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( 'wp', 'restricted_access' ); By default, always, if the user is not logged in it will give them the 404 page. The following two functions will keep non-admins out of ...


4

The HTML for the inserted internal links are generated by Javascript, so I'm not aware of any easy way to change it. The HTML generation is controlled from the wpLink.htmlUpdate method (HTML mode) and the wpLink.mceUpdate method (TinyMCE mode), in the /wp-includes/js/wplink.js file. Here are some ideas: Add a query parameter to the inserted links: We ...


0

Well, after some discussion with the developer, I was missing some key items in the add_filter line. I needed to pass along the "11","3". The three is the important item here. It is the number of variables to passback... the 3rd being the elusive $imgID. function massage_exif($content,$postID,$imgID){ $imgmeta = wp_get_attachment_metadata($imgID); ...


0

If you know the image ID, you could try this function: http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src


0

Here's a workaround you can put in a plugin or your theme's functions.php file. So far no problems. /* * Workaround Bug 30123 * Affects WP 4.0+, should be fixed in WP 4.1 * https://core.trac.wordpress.org/ticket/30123 */ function bugfix30123__action__admin_init() { if ( isset( $_GET['attachment-filter'] ) && is_string( $_GET['attachment-filter'] ...


2

There is nothing technically wrong with that, but backslashes are hard to type on some keyboard layouts. On a German keyboard for example, you have to hit the right AltGr key plus \ at the same time. This is not easy to type (and one of the reasons why I use an English keyboard). Use dots, colons or underscores to namespace your hooks. They are not bound ...


0

I would suggest this, which moves specific 'block-level' shortcodes outside of 'p' elements without affecting those elsewhere that may be intended to be inline: function my_fix_shortcodes($content){ if (strpos($content, '<p>') !== false) { /* Move 'block level' shortcode tags outside <p> elements by surrounding with ...



Top 50 recent answers are included