A type of hook that provides a way for content to be overridden programatically

learn more… | top users | synonyms (5)

1
vote
1answer
7 views

Archive filter disappears on no results?

I have been working through this example: http://www.advancedcustomfields.com/resources/creating-wp-archive-custom-field-filter/ That a colleague of mine found for creating a simple checkbox-based ...
0
votes
0answers
12 views

The title of an attachment is not working

I use this function to assign the title of every page: function my_title() { switch ( true ) { // [...] case (is_attachment()): wp_title(''); // This doesn't work ...
0
votes
0answers
9 views

How do can I pass data retrieved from a filter to template files?

I wrote this class to display only the current top level menu item's children: class deseng_navSplit { var $sorted_menu_items; var $args; function __construct($x, $y) { ...
1
vote
1answer
45 views

Use 'parse_query' filter to show posts that from multiple criteria

I am trying to filter the Posts page in the WordPress admin to show posts that meet the criteria for "A" -or- the criteria for "B". I've scoured documentation and can't find a good way to do this. ...
0
votes
0answers
8 views

Is this the proper way of switching the “Edit My Profile” link with my BuddyPress “Extended Profile” link?

I am using the Multisite feature enabled. I have a main site and a community site. On the main site the 'Edit My Profile' links is pointing to this link: ...
1
vote
0answers
25 views

Run oembed separately outside the_content()

I have this structure for my content.php : <div class="featured"> <!--featured image here--> </div> <h1 class="entry-title">Post Title</h1> <div ...
0
votes
1answer
13 views

Search pre_get_posts filter which can handle multiple post types and categories?

I have a Search which allows users to search multiple custom post types (CPT). That works fine. BUT I would like the query to exclude specific tags from each of the CPTs. Eg. Include ( (Posts ...
0
votes
0answers
14 views

Converting a checkbox filter for custom fields to a dropdown

I've been scratching my head trying to figure this out for awhile now and was wondering if someone could provide some help. My PHP knowledge isn't the best so I'm working with what I have and it ...
0
votes
1answer
30 views

paginate_links() Change the order of links

While using paginate_links() function of WordPress, i need to change the order in which it echo's its output. For example, by default it will output pagination links in this format: Default Output: ...
-1
votes
0answers
20 views

Is there a way to remove the wrapping anchor tag when outputting the_author filter?

I am trying to implement a custom plugin that will allow customized output of a post's author (including name, institution, and description). It outputs rich HTML, and the problem I am having is not ...
0
votes
0answers
10 views

Filtered $locale isn't applied on templates language lines

I change the global $locale by the following code in my functions.php function change_locale_on_admin ($locale) { if(is_admin()) { $locale='en_US'; } return $locale; } ...
0
votes
0answers
14 views

Conditionally Use image_resize_dimensions()

I used add_image_size() and image_resize_dimensions() to upscale and crop images in WordPress. It is working as expected except on the Edit Media page. Generally on this page you would see your full ...
0
votes
0answers
10 views

custom post types not appearing in Search multiple post types

I have a Search page where users can select to search for multiple post types: posts, pages, docs, newsletter. What is driving me nuts is that: a) Users can select posts/pages OR docs OR ...
0
votes
0answers
13 views

Add filter to Orderby Parameter using Array

Using WP-Query, I'm setting the Orderby parameter using an array: $events_args = array( 'post_status' => 'publish', 'post_type' => 'events', 'meta_key' => 'start_time', ...
0
votes
1answer
22 views

Problem adding class to body_class

I am trying to add additional classes to <body> based on certain conditions, so I have this code in my functions.php file of the theme : add_filter( 'body_class', 'custom_body_class' ); ...
0
votes
1answer
11 views

How to query if meta_key does exist or not?

Good day, I am trying to negate my query to show all instead except for a post with a custom field of file gallery. 'meta_query' => array( array('key' => ...
-2
votes
0answers
18 views

Get posts by attachment image size (dimensions)

I need to get all posts that have images attached, and uploaded image dimensions should exceed certain values, for example more then 1024x768px
0
votes
1answer
15 views

How To Get User Data in Callback Function for pre_user_nicename?

Whenever I update a user profile in the dashboard, the user nice-name gets changed in the database: Every time, a "-2" is added. I tried to reset the nicename (based loosely on this thread) by ...
0
votes
3answers
50 views

How to use return in my custom function instead of echo

I'm creating a function in functions.php with a custom hook, and from what I've read somewhere, it's good practice to return instead of use echo in a WordPress function? Correct me if I'm wrong. ...
0
votes
0answers
15 views

Rewrite Rules with custom taxonomies not changing

I've been messing around with wordpress custom taxonomies recently in conjunction with advanced search queries and I'm trying to make search urls look prettier by using rewrite rules, these taxonomies ...
2
votes
2answers
62 views

Filter translations (gettext strings) on specific admin pages

I'm trying to do a string replacement using gettext filter (source): function theme_change_comments_label( $translated_text, $untranslated_text, $domain ) { if( stripos( $untranslated_text, ...
2
votes
1answer
49 views

Always use <figure> for post images

The default behavior when it comes to full-width images in posts is this: If you insert an image alone, this HTML structure is produced: <p><img/></p> If you insert an image with a ...
0
votes
0answers
10 views

posts_clauses : Filtering Posts by multiple meta posts issue

Im trying to write function to filter posts by country and language, but as I see here posts are not filtered and I cant detect where is the problem. This is my code inserted in beginning of my ...
0
votes
0answers
10 views

Setup lazyload on post images using get_image_tag

According to jQuery.lazyload any images I'd like to "lazyload" need to have the src attribute replaced with data-original. I'm assuming I can do this using WP's get_image_tag filter, but I'm stuck on ...
1
vote
1answer
101 views

apply_filters('the_content', $content) vs do_shortcode($content)

Lets say I have a theme option or custom postmeta text area. Now I want to execute multiple shortcodes, general texts, images etc. What will be best practice and why? Option 1: $content = //my text ...
0
votes
0answers
47 views

add current-menu-item to multiple custom post types

I have two custom post types, and I have trouble adding the current-menu-item to both. In my functions.php I have following code: function additional_active_item_classes($classes = array(), ...
0
votes
0answers
23 views

do_action filter function from add_action array

I am looking at the following setup: -- Combing multiple functions into single action -- add_action( 'single_post_meta_start', array( $this, 'the_title' ), 10 ); add_action( ...
0
votes
0answers
8 views

Widget is breaking on filter function

I have created a widget which displays posts based on Display Posts shortcode. All works fine till I have added filter to public function widget() to output titles only (and need to be executed only ...
0
votes
1answer
36 views

Use external link in the add sub menu

I want to show the data in the external plugins.php file. the below url path is correct but its not showing the file data. Whats the problem? add_submenu_page( 'antify', 'Plugins', 'Plugins', ...
0
votes
1answer
24 views

Add sub menu page in your plugin

this is how i am adding the menu and trying to add the sub menu page which is not adding. party-reservation.php function a_qoute_admin_action() { add_menu_page(__('Reservations Pages'), ...
1
vote
0answers
32 views

<p> tag removed not using a filter

Very strange WordPress behavior: <p> tags are removed when placed inside <pre> tags, but not always. for example, this works fine: <pre><p>This is a ...
0
votes
0answers
41 views

Removing a line from a WP core function (comment_template.php) - filter or other technique?

a The effect I want to achieve - at least at this point - is simply to have the comment reply link continue to appear below comments even after "max_depth" for threaded comments has been reached. ...
1
vote
1answer
12 views

Is there any filter to trigger as soon as media is uploaded to post or page?

I am new to WordPress. I want to change attributes of image when uploaded to page or posts. Is there any filter for it? Thanks in advance.
0
votes
1answer
30 views

Custom nav walker: How to acces the $args parameter?

I am creating a custom nav walker. I noticed that the nav walker class from the WordPress core is written rather rough – much of the stuff going on could be spread out through various methods, so I ...
0
votes
0answers
14 views

Remove image width and height on replace

I've already figured out how to remove the height and width attribute from images on insert: add_filter( 'get_image_tag', 'remove_width_and_height_attribute', 10 ); add_filter( 'post_thumbnail_html', ...
1
vote
1answer
162 views

How can I see a list of my Custom Post Types of the last term I was in?

Sorry about the title I do not know how to put the question in the form of a title very well but my question if very descriptive. Iv been meaning to asking this question for a while now and would ...
1
vote
2answers
126 views

Custom Taxonomy breaking pages permalinks

I'm stuck for some days with this problem and I don't know what else to do. With %somethingHere% on slug rewrite, pages permalinks are broken (CPT AND CT OK). Without, I don't have my desired Post ...
0
votes
0answers
12 views

WordPress Custom Field Filter Broken For Comparison

I'm running a custom field - event date and time - that uses a UNIX timestamp to denote when an event takes place. I'd like the user to be able to filter events in the past or the future. The code ...
0
votes
0answers
24 views

How can I use a filter/hook to modify the URL passed in the content of an [embed] shortcode?

If I pass the [embed] shortcode an absolute URL that only includes the path (i.e. it starts with a slash and is hosted on the same server as the page itself), if it's a movie file, it doesn't ...
0
votes
0answers
17 views

Filter custom post type by tags

I really doubt if this is possible but I would like to filter a custom post type with Isotope based on the tag of the post and not the taxonomy. I'm currently using $terms = get_terms("taxonomy"); ...
0
votes
0answers
48 views

Woocommerce Product Category Filter by Parent

I don't think the title is detailed enough, but the main issue here is making a filter with three drop-down menus, each one getting populated after selecting the previous (apart the first one). An ...
-3
votes
1answer
40 views

Which action/filter can i use for a Member Plugin [closed]

I'm a beginner in Wordpress Plugin development. I want to write a Plugin for a Member Part on my Page. I know, that Plugins for this Problem available, but i want to create an own Plugin ;) I want to ...
0
votes
0answers
45 views

Filter wp_get_attachment_image

I'm working on a new WordPress plugin, that will have to change the media library directly. For that I have to overwrite or filter the wp_get_attachment_image function, that class-wp-media-list-table ...
0
votes
0answers
15 views

Create Featured images on the fly

The title is too short to descirbe what i want to accomplish so let me start. I have a custom type ('chesspuzzles') and I want to create the featured images on the fly (and use them in widgets too, ...
0
votes
0answers
16 views

How To Filter Tags by Category

I have a GIF blog with around 15.000 posts and around 8000 tags. These posts are into different categories (2 categories only). The two categories i have are "Reaction GIF" and "Normal GIF". Is there ...
0
votes
0answers
21 views

Filter for wp_embed_handler_youtube not working

In Wordpress 4.0, if I create a new post and paste a YouTube link directly into the post editor, Wordpress will automatically convert it to a YouTube embed tag. I'm trying to edit the default output ...
6
votes
1answer
88 views

Modify links when inserted by WYSIWYG editor

Is there any possibility to hook into the editor of WordPress so that if a link to an internal content is inserted via the WYSIWYG editor the post id of that linked post is added as a data attribute ...
0
votes
0answers
16 views

Write Custom Access Control Code For WordPress Download Manager

The WordPress Download Manager plugin by default allow us to select which rule can access the file. But I have a special case, I want if the user have a meta date equal to specific value then the ...
0
votes
2answers
11 views

Image filter works on attachement pages but not posts. I can't get the image ID

I'm using a plugin called Exifography. They provide the capability to use filters to adjust for your purposes. In the example provided I'm simply trying to get the height & width of the image and ...
0
votes
0answers
14 views

Run function after theme is installed for the first time

I want to run a function to add default widgets for my theme when it's installed for the first time. I tried add_action( 'after_switch_theme', 'add_theme_widgets' ); but it resets the widgets back to ...