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

learn more… | top users | synonyms (5)

0
votes
0answers
58 views

How to create filter for site

Good afternoon. Learning WordPress, I would like tips on how to make the filter on my website (not in the admin panel). For custom fields using magic fields 2 to display all the records I've just ...
0
votes
0answers
85 views

Include a page template along with add_theme_support()

I'm not even sure this is possible but before I start thinking up crazy solutions, I'll see if there is a WordPress way to do it. Here's the deal. I have a timeline jQuery plugin all set up on ...
0
votes
1answer
84 views

Gallery stripped from excerpt of post

I'm having trouble with galleries being stripped/filtered out of the content of the post excerpts before the "read more" click (the galleries load just fine when you click and read the post all by ...
0
votes
1answer
244 views

Wordpress: Apply filter/hook to a particular sidebar widgets?

I'm developing a theme that has more than 5 different sidebars and I want to apply a function to a particular one of them for styling purposes. Basically, the function will modify it's params using a ...
1
vote
1answer
136 views

How can I replace an oEmbed URL in post with actual embed HTML

What I want is to get the output of the Twitter oEmbed system into my actual posts. IMHO the embed output itself is high-quality, semantic HTML and I'd rather have it inside the post than in the embed ...
0
votes
1answer
57 views

Is there a filter to programmatically change the HTML tab switching output of the page editor?

I am wondering if Wordpress allows us to change the onclick attribute of the tab switching in the HTML editor? For example this is the a tag for the Visual editor: <a ...
0
votes
1answer
28 views

Passing variable from filter

I have this filter: function wpa_filter_nav_menu_objects( $items){ global $count4footer; foreach( $items as $item ){ $count = countPosts($item->ID); if($count!==false){ ...
0
votes
1answer
78 views

What filter or action to replace comments or add new comment system

I am looking to make a plugin for my site, which either replaces the current comments in a post or adds an additional comment system. I am getting the comments from a custom RSS feed from my forum ...
0
votes
1answer
28 views

Which filters or actions involve with index page for plugin?

I decide to manipulate index page or all pages except admin page with plugin but I don't know which filters or actions control index page. for example if I want write plugin that shows a link to admin ...
0
votes
2answers
30 views

Deleting Certain terms from appearing on the front end as links

I've put some thought into this but Can't really figure out what direction I take in getting rid of certain terms in my testimonial_category called 'home', 'homeone', hometwo. I only want to stop ...
1
vote
1answer
216 views

Replace audio links with jplayer using the_content filter

I am attempting to use : add_filter( 'the_content', 'filter_function_name' ); To find all of the anchor tags in my post which link to a .mp3 file, and then replace them with a jplayer instance that ...
0
votes
1answer
51 views

how to add_filter to non hook function

the idea is apply some filters if the user select the option in the theme, but i have a problem i made a function that replace the post_thumbnail_html for a personalized html then, i create other ...
1
vote
1answer
72 views

String regex match replace for role 'contributor' only

currently I'm using the below code to add rel=nofollow and target=_blank to all external links of my site's content but I would like this to happen only on Contributors posts. IE, Authors posts and ...
1
vote
1answer
2k views

Filter custom post type using multiple taxonomy dropdowns

I'm trying to create two dropdown boxes on a custom post type page called Activities. One taxonomy category is for Activities Grade Level and the other for Activities Type. With what I have now, if ...
0
votes
0answers
40 views

Redirecting instead of returning value in add_filter function

I have a filter for post_data before use wp_insert_post: function save_custom_post(){ $post_data = apply_filters('cpt_post_data', array(....)); do_action('before_save_cpt'); wp_insert_post( ...
0
votes
2answers
491 views

How to redirect non-logged in users to login with post_password_required()

I have created a membership site which is working how I would like in that non-members cannot view private pages. However, I want that when someone who has not logged in, clicks on a link that links ...
0
votes
0answers
161 views

Using the URL filter on wordpress

I have a form which allows users to filter posts by selecting multiple categories. It works well and I wanted to enhance it so that users can get what they are looking for. What I understand is that ...
0
votes
0answers
82 views

attachment_fields_to_edit 3.5 : How to change the 'link to' options?

In <3.5, I was using this filter: if (substr($post->post_mime_type,0,5) == 'image'){//array shift is being used to get the first element, [0] $html = "<input type='text' class='text ...
1
vote
1answer
131 views

Search filter triggered & sort by custom post type

I am using a plugin (Relevanssi) and a custom function to sort the search results by custom post types (see below). This is working great. add_filter('relevanssi_hits_filter', ...
0
votes
0answers
169 views

Filter “Awesome Filterable Portfolio” Plug-In to Display a Specific Category by Default

I am using the "Awesome Filterable Portfolio" Plug-In. You are supposed to put the short code on whatever page you want the portfolio to appear: [af-portfolio] The portfolio does appear with the ...
0
votes
1answer
52 views

What are the steps + prerequisites for using an add_filter?

Hey all I'm a WP noob and I have the task of cleaning up the mess other people left when they edited plugin cores. To my understanding, there are such things called filters in WP. I am not sure how to ...
1
vote
1answer
91 views

Add new post with predefined / preset date

The current situation The plugin I'm currently working on is an additional post list view: A calendar, as you can see in the following screenshot. Admin calendar view with MP6 and handheld screen ...
0
votes
1answer
209 views

Hook in a sidebar widget and add some markup

I'm looking to hook into a sidebar widget, this one in particular loads the members. All I'm looking to do is add a link into the widget, I managed to get a result but it's not quite right. It ...
1
vote
1answer
742 views

How to apply filter at search of woocommerce products?

I want to change woocommerce search. And want to limit the search to Product title and Category and Tag only excluding description and short description. Search Form is in ...
1
vote
2answers
94 views

Filter my args by the post 1st letter

I filter my WP_Query by this script: $args = array ( 'posts_per_page' => $posts_per_page, 'post_type' => $post_type, 'meta_key' => 'post_views_count', ...
0
votes
2answers
62 views

How to turn this customized core function into a filter/action in functions.php?

So in template.php the original function looks like this: function meta_form() { global $wpdb; $limit = (int) apply_filters( 'postmeta_form_limit', 30 ); $keys = ...
0
votes
1answer
117 views

How to add_filter/action to comment out CSS generated by admin function?

So in wp-includes/admin-bar.php there is a function that adds CSS styling to the page: function _admin_bar_bump_cb() { ?> <style type="text/css" media="screen"> html { ...
1
vote
2answers
220 views

Clarification on filters and hooks

I am about to start my first WordPress project and I have the task of moving customized core code that override the core into separate functions/files (this way it'll be easier to maintain when we ...
0
votes
2answers
121 views

Filters on Login Page

I am trying to modify the login page using built in filters. The add_actions are working as expected, but I cannot get the filters to work. This is the code that I have in my functions.php: ...
0
votes
1answer
80 views

How does wordpress add 'style' attribute to <a> element

In my post the html code is like this: <p><a href="http://mysite.com/xxx/xxx/xxx/mypic.jpg"><img class=" wp-image-124 aligncenter" alt="xxxx" ...
0
votes
1answer
744 views

Apply the_content filter to a custom field with multiple values

I have a custom meta box set up that allows users to paste the Youtube URL of a video so that it can be embedded into a post/page. The meta box can be repeated so that a user can add as few or as ...
0
votes
1answer
34 views

Combine two conditions in one statement syntax [closed]

I have two queries that I would like to combine because it becomes a lot of code and I think that's not necessary but I make a mistake with the syntax I want to combine } elseif (is_category( ...
0
votes
0answers
41 views

Adding Search Filter on Informational Website

Background: Say I am creating a website for a popular mobile brand. On this site I will have "informative" articles. Every mobile will also have a short overview, followed by specs and images of the ...
0
votes
1answer
41 views

How can I apply a WP filter on specific plugin version

I have the plugins list in 'wp-admin/plugins.php' page. For each plugin there is some meta info extracted by WP from each plugin file: /*  * Plugin Name: somename  * Version: 1.2.3   */  I want to ...
0
votes
0answers
154 views

Disable Filter and Allow Embed/iFrame on Blogger Import

I'm trying to import blogger posts into a wordpress site but all embedded audio/video content is getting filtered out. I've commented out the following in kses.php: // Post filtering ...
0
votes
1answer
161 views

apply_filters to featured image

I have a page where I have embedded the page using these lines of codes at function.php: //------Embed Content------ //Title function CustomFunction_ShowPage_Title($id) { $post = get_page($id); ...
0
votes
1answer
282 views

apply_filters('get_the_content', $content) + Except

I'm using the following function to load my content dynamically: apply_filters('get_the_content', $content) However, I would like to apply an excerpt to this method but the only way I know how to ...
1
vote
2answers
397 views

Custom Post Templates

The Issue: I am looking for custom single post templates, to add or remove individual elements as a function of a normal single post. There are a lot of ways to create custom post templates for ...
0
votes
1answer
125 views

Correct method of redirecting user login

The popular membership plugin 's2Member' uses the wp_login action hook to wp_redirect a logged in user to where s2 deems appropriate. This causes a conflict with other plugins, in that other plugins ...
0
votes
1answer
60 views

an action hook when a post reaches a certain number of views

I am using WP Post Views plugin to display the post number of views. I use: <?php if(function_exists('the_views')) { the_views(); } ?> I am creating a badge system for my wordpress site. My ...
0
votes
1answer
387 views

dynamically filter by category via sub-menu

I'm trying to figure out if it's possible to dynamically filter my custom post types by category via a sub-menu I have set up. So I've set up a custom post type: news and enables categories that I ...
0
votes
1answer
58 views

Turn wp_tag_cloud into a front-end filter

I have a photo gallery with wp_tag_cloud in the sidebar to display hierarchical taxonomies that categorize photos. The taxonomy name is person. <div id="filter"> <?php wp_tag_cloud( array( ...
1
vote
1answer
134 views

Filter In Reply comments from Wordpress Admin Panel

Is there any way to filter the comments that are In Reply from the comments list? I basically just want to see the depth 1 comments on a separate filter. @GhostToast Ive added this to create a new ...
0
votes
1answer
128 views

Filter causing loss of _wp_attachment_metadata

A while back I asked this question: Save camera info as metadata on image upload? Long story short, it works in that the custom field is saved into wp_postmeta and I can access that value. But as I'm ...
0
votes
2answers
175 views

Override parent theme function that is not hooked or in the functions.php file

I need to remove a function from the parent theme and replace it within the child theme. The function is called print_meta($meta_box). The function is not pluggable and it located in a random file, ...
2
votes
1answer
49 views

Why do filters/actions require an argument count?

I was just looking at plugin.php trying to answer the above question and I couldn't work it out. The actual code that calls filters is this: do { foreach( (array) current($wp_filter[$tag]) as ...
1
vote
1answer
100 views

Hide content editor for posts after approriate date

I am tuning my new site and i what to disable Content Editor for post created after date X, but for posts that created before that date Content Editor must be on its place.
0
votes
1answer
145 views

How do I safely force get_theme_mod() to use a defined get_option(“stylesheet”) value?

In our development process we have several branches of the same theme for each developer. Theme branches live in different directory names, so when doing get_theme_mod(), get_option("stylesheet") can ...
0
votes
2answers
324 views

how to remove filter from wordpress shortcode output

Twitter URL plugin add the filter to the_content. This filter messing up the output of my plugin shortcode output. So I wish to remove this filter only for my shortcode output. ...
0
votes
0answers
127 views

Can't update an option when the publish_post action is fired.

I'm using Tom McFarlin's Plugin Boilerplate, and I'm facing this huge problem where I can't update an option when the publish_post action is fired. I have a function that hooks into the publish post ...