Tag Info

New answers tagged

0

First thing is the add rewrite rule function. You have - add_rewrite_rule('^wp-api/pugs/?([0-9]+)?/?','index.php?__wp-api=1&pugs=$matches[1]','top'); wp-api/pugs/?([0-9]+) this means, when you request <url>/wp-api/pugs/123, you will get a query variable pugs with parameter 123. $var = get_query_var('pugs'); // = 123 Now, you don't really need ...


1

You are almost close. add_filter( 'some_custom_filter', array( $this, 'filter_suppress_the_content' ), 10, 3 ); // the above line states that, the method `filter_suppress_the_content` should have three arguments, where you have used nothing. public function filter_suppress_the_content() { return true; } // comparing your code, this method should have ...


0

$seach_values can be changed whenever the site redirect, be sure that $search_values still keeps the input values from your search form. To be sure I suggest use GET or POST to pass the values from form. So, your comparing statement should be $_GET['grades'] == $term->slug Here I suppose your search form use method="GET"


0

Add this code to the themes custom css option. It will hide slider for all devices that are narrower than 767px. @media screen and (max-width: 767px) { .slider-wrapper { display: none; } You should check the theme files though to be sure that .slider-wrapper is the correct reference to the slider. If it's named something else just change that part ...


0

admin_url() should be used. However for some websites this request gives error 404 in front-end admin_url('wp-admin/admin-ajax.php') should point to an actual file (admin-ajax.php), as such WordPress won't pass it through index.php, and so it shouldn't lead to the theme's 404 page. (Unless the file has been deleted). ... unless you have a .htaccess ...


0

As described in codex, in_category() checks categories directly assigned to the post. That means that if a post is assigned to a child category but not to the parent, using in_category() with the parent category will fail. Example: you have the category with ID 10, which is child of category 9. The post is assigned to category 10, not to 9. The following ...


0

I found the prolem and resolved it. I edited the following: add_complete_tour($tourTitle,$keywords,$sourceTour,$destinationTour,$duration,$tourContent,$agancyservice,$passports,$transport,$hotel_name,$hotelRate,$room1,$room2,$room3,$room4,$desc); And added $reg_errors to global variable in add_complete_tour function: global ...


0

The answer is right there in your error. Your first if checks that $reg_errors is definitely an instance of WP_Error, but your elseif doesn't. You need: elseif ( is_wp_error( $reg_errors ) && count( $reg_errors->get_error_messages() ) < 1 )


2

Anyway, basically Hody_McGee gave the answer in his comment: You could use wp_localize_script(). As it states in the Codex: [wp_localize_script()] can be used to make any data available to your script that you can normally only get from the server side of WordPress. How do we do this? <?php add_action( 'wp_enqueue_scripts', 'register_scripts' ...


2

The reliable two–way sync is simply not something that have happened in WordPress. The typical way is in line with what you are doing — pulling a copy of production database into development environment. Note that this is commonly the one direction it goes. It's much more problematic to try sync development back to production. As far as plugin ...


0

You can look here for some solution. add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields');


0

You'd need to put the variable's value onto the page so that javascript can pass it back to PHP using ajax. Ajax functions are a completely separate "page load" so even if you made it global it won't work. The best way to do this is using "wp_localize_script" (https://codex.wordpress.org/Function_Reference/wp_localize_script) Here's an full example of how ...


0

Please Note: Questions regarding 3rd-party plugins and themes are considered off-topic here at the WordPress Development SE. The best place to receive support for such items is the 3rd-party's official support channels. Please review the How to Ask section of our Help Center to learn more about what questions are on-topic and a good fit. ...


0

Alright, here to help :) If you find this helpful please share the bounty! Step 1: The Research My first hint was that these parts of the slugs are usually controlled by custom post type settings, thus I combed through the plugin files - finally finding that in the plugins in the file "class-wp-job-manager-post-types.php" inside the "Includes" folder on ...


0

Think I have solved this. I have created the following template to change the url: $url = $current_user->display_name; $urlwithhyphens = str_replace(' ','-',$url); header( 'Location: http://www.example.com/author/'.$urlwithhyphens.'/?geodir_dashbord=true&stype=gd_place'); I was having trouble with usernames with spaces hence the new variable ...


1

Just one thing to make sure of, you must put the page id in the brackets for the "is_page()" function. If your page ID was 12, you'd use it like this: if( ! is_page( 12 ) ){ You can find a page's id by editing it and looking in the URL for "post=". The Page ID will be directly after the "=" sign in the address bar.


0

The same implementation is provided for self hosted WordPress sites as one of the features of Jetpack plugin.


0

If you use Google Chrome you will have a built in spell check. I hope that helps. Changing anything in the WordPress.org site is very difficult as it is not a custom site like the ones we download and modify.


0

Try using absolute paths in src attribute. If your images are in your theme folder, you can use: <img src="<?php bloginfo('template_url'); ?>/yourImageFolder/yourImage.jpg" /> This way, URLs will be absolute even if you move your WordPress site to another server.


0

Comparator IN expects an array of values. Try to put your own values in arrays : $hobbiesvalue = array( get_field('hobbies_query') ); $sportsvalue = array( get_field('sports_query') ); $resultnum = array( get_field('number_of_results_to_show') ); I think using IN in this case may not be the best, but it should do the trick. You can also try to replace IN ...


0

All the answers you see here are correct enough, but here's what probably (probably!) really matters: If your multiple plug-ins use code redundantly, they'll be worse, performance-wise, than one plug in with all the functions and doesn't repeat itself. This is actually WordPress'argument for "why Jetpack isn't a resource hog"; they wrote really clean ...


0

This seems to work: function agr_wp_install($user){ ... } add_action('wp_install', 'agr_wp_install', 1);


3

I would be wary of things you read - e.g. there's a common myth that "having lots of plugins" is a bad thing, whereas of course what matters is whether they're well written or not. The time to load a large number of very well written plugins is neglible, whereas a line of bad code in one can easily screw things up for everything else. There might be a case ...


5

Having two or twenty plugins does not make difference because of the number of plugins itself. Maybe you can notice difference from one plugin to 1000 thousand, but not from 2 to 20. What the plugins do is what makes difference. Having 50 light plugins can be fast, while having one single plugin doing a heavy job or really poorly coded can be quite slow. ...


0

If you want to know about Sidebar Generator issue then you can use this codes:- if ( function_exists('dynamic_sidebar') && generated_dynamic_sidebar(1) ) No. Also, no need to use functions_exists(). This is one of the correct methods for registering and calling a sidebar in a template file. There's 2 steps. One. This code goes in your functions ...


1

The main component you are probably missing is dropping your customizations in an install.php file in the wp-content directory. If you look at the /wp-admin/includes/upgrade.php you will be able to see exactly how it is included and the installation functions you can override. I am not sure if that will be good enough to catch the hook you want to use but ...


0

WordPress' installation file defines a constant called WP_INSTALLING 27 /** 28 * We are installing WordPress. 29 * 30 * @since 1.5.1 31 * @var bool 32 */ 33 define( 'WP_INSTALLING', true ); https://core.trac.wordpress.org/browser/tags/4.1.1/src/wp-admin/install.php#L33 Given that, I think you could hook to an action like ...


2

If you check out the output() method in the includes/admin/class-wp-job-manager-setup.php file, namely this part: /** * Output addons page */ public function output() { $step = ! empty( $_GET['step'] ) ? absint( $_GET['step'] ) : 1; if ( 3 === $step && ! empty( $_POST ) ) { $create_pages = isset( ...


0

I was able to find a solution: if(!empty($search)){ $query = $wpdb->prepare( "SELECT DISTINCT user_id FROM wp_usermeta WHERE meta_key = 'pie_address_3' AND meta_value LIKE %s ", '%' . $search . '%' ); $ids = $wpdb->get_results($query); ?> ...


1

It's on the Tax settings page and is wp_options.woocommerce_price_display_suffix in the database. Please use the official site for WooCommerce and third-party plugin support, rather than StackExchange.


0

When I seemingly get nothing from an Ajax call I run Fiddler and examine the return when it comes to the request. The other day an Ajax call was failing inexplicably. Upon examining the return I saw another programmer was dumping an array into the output before I received my response. I never would have guessed that because the JavaScript never hit the ...


1

Your problem is probably because you do not return a json object but an html (actually mixed text and html), and you set jQuery to validate that the response is json, which it isn't. your code at the ajax handler should be something like $catshtml = wp_dropdown_categories(.....echo=0); $ret = array('data' => $catshtml); wp_send_json($ret); die(); on ...


0

That's expected behaviour, since you're calling wp_enqueue_script mid-page, so at that point the <head> ship has sailed, and the only other option is to enqueue in the footer, which is fine. I didn't spend too much time reading the actual script that you're enqueuing, but it seems like it it's doing some document.write() as soon as it's loaded, which ...


1

I believe you are looking for activated_plugin and deactivated_plugin, see the wordpress documentation:


0

The author key/value query won't work. Try modifying the query by moving the query out of the meta query like so: array( 'author' => $author, 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'leads_status', 'value' => '-1', ), array( 'key' => ...


0

Please User Role Permission Plugin For user wise Permission Link here


0

Assuming the images are posts. Register a new post meta for them and use the ID for your form in that post meta, this will allow you to relate to the form. https://codex.wordpress.org/Function_Reference/add_post_meta


2

Usually it is bp-legacy-js. But if you place a buddypress.js in wp-content/themes/your-theme/buddypress/js/ this file will be taken instead. The handle will be bp-parent-js The same goes for CSS files, if you place them in /your-theme/buddypress/css/. If you place the buddypress.js in a childtheme, the handle will be bp-child-js.


0

Outside of subqueries, MySQL will only process 1 query at a time. When running sql statements through phpmyadmin, it just executes 1 query after the other. To do the same thing in WordPress, it appears you just use 1 query per $wpdb object (those can have subqueries if desired, but not what's needed here).


1

(Partial answer as I'm familiar with AWS, not Google Drive.) Having a WordPress DB stored somewhere on a cloud service is, in my opinion, no worse that hosting the site on a virtual or cloud server (given virtualisation platforms all allow you to reset the server's root password - albeit typically with a reboot - so your entire machine is at risk if someone ...


0

This was happening because of a woocommerce.php file in theme's root folder, that was overriding a lot of stuff, including single-product.php, via woocommerce_content() function. As redelshaap and woocommerce's documentation say, this is not the best way to implement theme compatibility and customization... ...


1

Which wp_get_recent_posts()do you retrieve the most recent posts. For meta data, like published date and modified date use additional functions. For the published date is the_date() helpful. For the modified date use the_modified_date(). The functions are a part of the Template Tags, useful for Theme and direct output. But she have also parameters to get ...


1

I like to keep my templates short and sweet, for this reason, bulky (or long pieces of) code like the code in your question, I tend move that into a function and then just call the function in my templates or use do_action() calls. I also split my functionalities between different functions files so that I don't end up with a functions.php which is 2000 ...


0

With your code given in OP, it is hard to exactly tell you where you are going wrong. One note on what I can, you should never use create_function(), it is a security thread that can be exploited by hackers. You should avoid using that completely. Rather make use of proper closures that was introduced in PHP 5.3. To help you, here is a basic skeleton which ...


2

The thing with class methods is that unless they're static, they belong to an object. And in your case your object is: new WC_Admin_Taxonomies_new(); Which means PHP will create the object and keep it in memory. But unfortunately, since you're not assigning this object to a variable, you have no way of referencing it later in your code. Off the top of my ...


0

If you take a look at register_sidebar() source it just stores data in $wp_registered_sidebars global variable. You could examine it and retrieve data from it as you need to.


2

That depends on what the plugin does, whether your theme relies on it and whether it is your own plugin or not. For example, when it's a plugin that adds a custom post type with special theme pages and stuff (like events or a portfolio), than you should integrate it in your theme using your second method. On the other hand, when it's a plugin from an ...


0

Change your id from plugin_text_string to plugin_options.


1

Before you get to relating things in WordPress, you should decide what things are. In a very nutshell there are: Posts of post types (native ones being pages and blog posts) Terms of taxonomies (native ones being tags and categories) There are some things that WordPress does smoothly out of the box. Such as post being assigned a term or term having a ...


1

Just match the callback in your remove call - array( CLASSNAME, METHOD ): remove_action( 'user_register', array( 'Groups_Registered', 'user_register' ) );



Top 50 recent answers are included