javascript onload calling a function of a plugin

I did not test this, but something like this should work. Edit the function all_js in your plugin file and add these lines: $.post(“/wp-admin/admin-ajax.php”, { idPost: $(“.post-read”).data(“id”), action: “read” }, function(response) { // Handle errors etc. }); You also need to ensure that the button data changes when the AJAX request is made. Here is … Read more

custom taxonomy and custom post type url conflict

Try this code. It may help you. class Tax_Seo_Perma { public function __construct() { // Hooks add_filter(‘rewrite_rules_array’,array($this, ‘create_rewrite_rules’)); add_filter(‘wp_loaded’, array($this, ‘flush_rules’)); add_filter(‘post_link’, array($this, ‘modify_link_addresses’), 10, 3); //add_filter(‘post_type_link’, ‘tsp_write_link_addresses’, 10, 3); } public function flush_rules(){ global $wp_rewrite; $wp_rewrite->flush_rules(); } public function create_rewrite_rules($rewrite) { global $wp_rewrite; // loop through custom taxonomies $args = array( ‘public’ => true, … Read more

How to customize user search

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); ?> <ul class=”author-list”> <?php foreach ($ids as $id) { ?> <li> <img width=”90″ height=”90″ src=”https://wordpress.stackexchange.com/questions/182955/<?php echo get_user_meta($id->user_id,”pie_profile_pic_5″, true); ?>” class=”attachment-agent-image wp-post-image”> … Read more

Multiple navigation menus to a location?

is this look like the menu you aiming ? Here how to create it Create custom menu in your functions.php , // main menu function main_nav() { wp_nav_menu( array( ‘theme_location’ => ‘header-menu’, ‘menu’ => ”, ‘container’ => ‘div’, ‘container_class’ => ”, ‘container_id’ => ”, ‘menu_class’ => ‘menu’, ‘menu_id’ => ”, ‘echo’ => true, ‘fallback_cb’ => … Read more

How to add rewrite rules and pagination to retrieve attachments files?

Based on the comments of @Milo and using the rewrite analyzer plugin I found what I understand as a conflict in the rewrite rules?. The following url: exams/high-school/city-name/subject/math/ matches the following rules Pattern: (.?.+?)/page/?([0-9]{1,})/?$ Subtitution: pagename: exams/high-school/city-name/subject/math paged: 1 Pattern: (.?.+?)(/[0-9]+)?/?$ Subtitution: pagename: exams/high-school/city-name/subject/math/page page: /1 Pattern: exams/([^/]+)/([^/]+)/subject/([^/]+)/?$ Subtitution: pagename: examns level: high-school city: city-name … Read more

custom_list_table edit/delete bulk actions

above is my check box, normally name=”book[]” can someone explain what the purpose of the [] is? This is allowing the checked values to be returned as an array when getting the results, if you have more than one value checked. Besides that, I can’t tell what you’re trying to do in order to be … Read more