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

learn more… | top users | synonyms (5)

1
vote
1answer
64 views

Question about how do wordpress filters/actions work

I have a question that I'm curious. In WordPress we can add a filter or action like this code: add_filter($filter_Name, $function_will_be_hook); add_action($action_Name, $function_will_be_hook); ...
0
votes
2answers
65 views

How to check a filter are applied

I want to apply this filter from this question. add_filter( 'the_content', 'pre_content_filter', 0 ); function pre_content_filter( $content ) { return preg_replace_callback( ...
1
vote
0answers
42 views

Wordpress custom admin notice still displays after wp_insert_post_data validation

I am trying to validate post data before saving, specifically checking to see if an image exists within the first 750 characters of the post content. The code below works and display the admin notice ...
0
votes
1answer
41 views

Making an add_filter() call from within an add_filter() call

I am creating a plugin where I am checking for parameters passed in the url for a page, then using the values of those parameters to change the Title, meta tags and make some other SEO changes. But I ...
0
votes
1answer
63 views

How to edit classes in body tag?

I'm trying to edit classes in the body tag for custom post types so I can display the pages full width using the WooThemes Canvas built in full width class - instead of overriding it. By default it ...
0
votes
1answer
63 views

get_posts and wp_autop (remove filter)

I just transformed my query_posts function in a get_posts function. Here is my old function: <?php // The Query query_posts( 'cat=170&showposts=4' ); remove_filter('the_excerpt', 'wpautop'); ...
0
votes
1answer
29 views

Need help using a filter on the default Categories widget

I need to add the "All Categories" item to the default WP categories widget. I can see that there's a filter that I can hook into in the core (line 485 default-widgets.php). ...
5
votes
1answer
131 views

Filter username field on registration for profanity and unwanted words

How do I add a filter to the username field to stop new users from registering using unwanted words such as administrator or general profanity? Ideally, if I could add a large list of words that are ...
0
votes
0answers
39 views

How do I turn off local pickup for a specific shipping category?

Can anybody provide me with some code that would help? I need to be able to offer flat rate shipping AND local pickup for all product categories apart from 2, which I have assigned to a separate ...
1
vote
1answer
44 views

When to add_filter() to Custom Query

I have complicated query where I need to join multiple tables. I'm doing that via add_filter('posts_join') - my question is, when and where do I add the filter so that it only applies to the custom ...
0
votes
1answer
39 views

cant output grayscaled ive created using add_image_size

I am trying to create a gray scaled image of the image i upload. I have been able to upload the image and create the gray scaled version by using this code: ...
0
votes
1answer
322 views

Modify Redux Framework Options in Child Theme

I have a wordpress theme that I am modifying the look and feel by making a child theme. The parent theme I am using uses the redux framework. Im a bit new to using filters and hooks, but I want to ...
0
votes
0answers
45 views

Cforms II conditional processing

I have a form with 2 email fields. When the form is submitted I need to check whether the emails entered in the form already exist in the database, if any one of the emails entered on the form exist I ...
0
votes
1answer
56 views

Add Filter - Pass Variable (PHP < 5.3)

When using Anonymous Functions in PHP < 5.3 I get this error: Parse error: syntax error, unexpected T_FUNCTION This is especially troublesome for add_filters. For instance, if I want to make a ...
0
votes
1answer
54 views

Custom filter on all post page (admin backend)

I have a custom post type called sales_listing. On the All Posts page I have it showing a thumbnail column which is inserted into the postmeta table. It only creates this entry into the postmeta table ...
0
votes
2answers
568 views

WooCommerce Variable Product Price - Where is “From” text generated from?

The following code from github will add "- [max price]" to all variable products displayed in product archives. I am wondering how I could also remove the "From" text inside the same filter. ...
0
votes
1answer
170 views

Remove Site Name from wp_title WITHOUT removing from <title> attribute

I'm using wp_title() in the body of my theme to print out the page title name at the top of the page, way before the content. This unfortunately also prints out the site name, which is redundant in ...
0
votes
0answers
126 views

Rename uploads filenames to POST-ID on upload

I would like to change the way Wordpress rename uploaded files on upload. As I upload an image whose filename is "see-sunset.jpg", Wordpress will set up scaled versions and rename filenames to ...
0
votes
2answers
88 views

How do I use the 'http_request_host_is_external' filter

I'm having a really hard time trying to use the http_request_host_is_external filter. For some background, I'm trying to set up a separate server to handle private plugin and theme updates. The ...
1
vote
1answer
216 views

Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”

Good morning, I am trying to change name format that Wordpress uses to rename uploaded files. As I upload an image whose filename is "desert-landscape.jpg", Wordpress will set up scaled versions and ...
0
votes
1answer
30 views

Plugin default settings hook

I am writing a plugin where I want it's default settings to change in accordance to the theme that is selected. I have it working, but would rather provide an action hook for this instead of writing ...
0
votes
1answer
83 views

Is it possible to create an action hook using do_action() within add_action()?

Is it possible to create a new action hook like do_action('my-hook-name'); inside a call to add_action();? I'm aware this code doesn't work, but I was thinking something along the lines of... ...
0
votes
0answers
14 views

apply_filter('{$field_no_prefix}_save_pre', $value) function clipping HTML

In wp-include/post.php there is a function named sanitize_post_field($field, $value, $post_id, $context). In this, the apply_filter('{$field_no_prefix}_save_pre', $value) function clips the form type ...
0
votes
1answer
30 views

Regarding post text filtering

What does this statement actually do? $text = apply_filters('the_content', $text); It follows only these ones: $text = get_the_content(''); $text = strip_shortcodes( $text ); What filter(s) is ...
1
vote
0answers
202 views

How to hook a filter to catch get_post_meta when alternate a custom field output?

How to hook a filter to catch get_post_meta when alternate a custom field output? I have fill a custom field(meta data) in a post, just like this: <!--:de-->Nominale ...
0
votes
1answer
31 views

How to conditionally add a wp_filter

I have a WP filter I created that I only want to run on certain menu items. I am attempting to use - function add_nav_class($output) { $output= preg_replace('/<a/', '<a class="lsbb"', ...
0
votes
1answer
89 views

How to add nav menu items to a specific position within a menu

I'm adding login/logout links to a nav menu using the following code: function rp_add_login_logout_links( $items, $args ) { $link = wp_loginout( get_permalink( get_option( ...
0
votes
1answer
145 views

Remove CSS & JS files from Wordpress Main Page For Increase Pagespeed?

With the reference of http://stackoverflow.com/questions/12463304/wordpress-load-plugin-css-js-in-functions-php-w-conditional-tags answered by @maiorano84 i am using cforms, FancyBox, WP Page ...
1
vote
1answer
33 views

Is there a way to verified if an add_filter is already applied?

I have in my theme this filter: add_filter('widget_text', 'do_shortcode'); Now I'm developing a plugin where I have that same filter. I would like to know if is there a conditional that I can check ...
0
votes
1answer
112 views

is there a way to pass a parameter to a add_menu_page function?

I am trying to create a dynamic way of adding admin pages and submenus with different capabilities. So the first way i thought of which works BTW but is ugly is having all the pages in 1 folder and ...
1
vote
2answers
92 views

How to trigger the core WPLANG to make automatically set a language when the theme is activated? [duplicate]

I'm developing a theme especially for Bānglā blog posting, and it'd be under GNU license. I questioned about a Calendar Widget translation with some problems today, and got a comment saying: I'm ...
1
vote
1answer
54 views

How to hook some Unicode texts into calendar widget safely?

I collected a good numerals replacing function for WordPress calendar: function make_bangla_number($str) { $engNumber = array('0','1','2','3','4','5','6','7','8','9'); $bangNumber = ...
2
votes
1answer
37 views

How do I know what variables are passed in a filter/action and what their meaning is?

Something I have seen several times now and I don't understand is the following: In a theme's functions.php a function is defined and then attached to a hook, like so (simplified example): function ...
0
votes
0answers
46 views

Set post title and slug from meta fields not working

I have a custom post type where I have the post title disabled. I want to set the post title and slug from some custom fields. I was using this and it worked great, but since I've upgraded by site to ...
1
vote
2answers
29 views

How would go about if I just want a temporary function?

How would go about if I just want a temporary function? (It's a converter just for converting Access to Wordpress tables). I want to execute several times so therefore I want it automated, but I don't ...
0
votes
2answers
432 views

Can't change a label in woocommerce with the normal filter

// Hook in add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); // Our hooked in function - $fields is passed via the filter! function custom_override_checkout_fields( ...
0
votes
0answers
39 views

In a page I need to display posts “standard” and post “videos” with post formats

I have created a filter to display "standard" posts in a page by selecting category and it works well but it deletes "video" posts. I need to create another filter to display the "video" posts from ...
0
votes
0answers
32 views

Filter posts with missing attributes

I'm doing house-keeping on my posts, and a lot of IMG tags in my old posts do not have class="alignnone size-full wp-image-xxx" or width="xxx" height="xxx". The attributes are needed for responsive ...
0
votes
1answer
170 views

WooCommerce Custom Product Validation

I'm attempting to build a membership system in WordPress that utilizes WooCommerce with Gravity Forms and integrates with SalesForce. Can somebody give me some direction on how to properly utilize ...
1
vote
2answers
463 views

Advanced Custom Fields and Yoast SEO keyword analysis

The problem I'm having is the keyword page analysis tool doesn't read my custom fields so I am trying to figure out how to run a filter on them. I found a blog post on Yoast website here here which ...
0
votes
1answer
16 views

Wordpress - show all posts + ones with specific tag

I have 3 types of posts as below Normal posts without any tag With "featured" tag With "sold" tag On a page, I just want to show normal posts + ones with featured tag and don't want to show posts ...
0
votes
1answer
20 views

child_of not working while searching

I'm trying to limit search to a parent page and its own child pages. I've changed searchform.php adding this code: <input type="hidden" value="<?php global $post; $ancestors2 = ...
0
votes
1answer
86 views

arguments for comment_notification_text filter

From WP codex: comment_moderation_text: applied to the body of the mail message before sending email notifying the administrator of the need to moderate a new comment. Filter function ...
1
vote
1answer
90 views

Add Lightbox To WordPress Native Gallery

Is there a way to check if a gallery is linked to an attachment page or to an image file via jQuery or WP filter? I'm trying to add a lightbox to gallery image that is linked to image file. But I ...
0
votes
2answers
49 views

Filter didn't work on content class (hybrid_post_attributes)

I'm developing my new theme using Hybrid core framework and trying to add my class item on hybrid_post_attributes generated class using filter with this code. add_filter( 'hybrid_post_attributes', ...
0
votes
1answer
78 views

Search with filters and title

I would like to search in custom_post by title and by the ACF fields. So, I used the WP_Query WordPress function but I can't filter by the title, just by the filters. When I submit my form, I have ...
1
vote
1answer
39 views

Inserting above the comment template

I want to insert content, just above the comment template.I have tried all the word-press filters and hooks but failed. I want to insert the content above the comment template, I mean above all ...
0
votes
1answer
235 views

Remove a particular State from Woocommerce Checkout List

I am attempting to remove a single state from the woocommerce checkout page. I've found the file in woocommerce core that I can edit to remove the state, but I would prefer to do it through a theme ...
1
vote
1answer
74 views

Change the footer text on the login page

I am customising the login page and would like to alter the footer text that takes the user back to the website. Ideally and as an example, changing it from the first image, to the second just below: ...
1
vote
1answer
44 views

How do I run through a Wordpress loop called from a filter function?

So I'm trying to populate an Advanced Custom Fields selectbox with a nice complicated array based off some post data. I've been trying to do this by doing a custom query and loop through the returned ...