How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor

I followed this tutorial which is adding a custom button into Visual Editor as it is supposed to. But this is not adding the button into the Text(HTML) Editor. Can you please let me know how I can add my own button into Text(HTML) Editor only (or at least both! and not Visual one)

function enqueue_plugin_scripts($  plugin_array) {     //enqueue TinyMCE plugin script with its ID.     $  plugin_array["green_button_plugin"] =  plugin_dir_url(__FILE__) . "index.js";     return $  plugin_array; }  add_filter("mce_external_plugins", "enqueue_plugin_scripts");  function register_buttons_editor($  buttons) {     //register buttons with their id.     array_push($  buttons, "green");     return $  buttons; }  add_filter("mce_buttons", "register_buttons_editor"); 

I want to add a search filter in my custom plugin backend

I am developing a plugin.in the backend i want a search filter ,which go through entire table and list the details.

I have simply created a form ,attaching the code here.

 public function SearchSection(){      echo '<p class="search-bx">     <form action="" id="searchForm" method="get">     <label class="searchbar_st" for="#">Search :</label>     <input type="search" id="sbr_search" name="s" value="">         <input type="submit" id="search_submit" class="button" value="Search"></p>         </form>';                 global $  wpdb;          $  table_custom = $  wpdb->prefix . 'my_custom_table';                    //-----------------------------         $  output = '';          if(isset($  _POST['searchForm'])) {           $  search = $  _POST['searchForm'];           $  search = preg_replace("#[^0-9a-z]i#","", $  search);                  $  query = mysqli_query("SELECT * FROM 'my_custom_table' WHERE town LIKE '%$  search%'") or die ("Could not search");           $  count = mysqli_num_rows($  query);                      if($  count == 0){             $  output = "There was no search results!";                  }else{                    while ($  row = mysqli_fetch_array($  query)) {                        $  id = $  row['customers_id'];                 $  Name = $  row['customers_name'];                 $  items = $  row['product_items'];                 $  period = $  row['billing_period'];                 $  amount = $  row['billing_total'];                    $  next = $  row['next_payment_date'];                 $  previous = $  row['previous_payment_date'];                 $  billing_link = $  row['billing_link'];                         echo "<tr>";                          echo "<td><a href=".$  billing_link."> ". $  id ."</a></td>";                 echo "<td>". $  Name ."</td>";                 echo "<td >". $  items ."</td>";                 echo "<td>".$  currency. $  amount.' / '.$  period."</td>";                 echo "<td>". $  next ."</td>";                 echo "<td>". $  previous ."</td>";                 echo "</tr>";                     }             }             else{                 echo "<tr><td cols=an='5'>No records found</td></tr>";             } 

And the code is not correct.Could anybody point me in the right direction.

Custom Menu not working on Test Server

I need to add custom menus to the footer of a WordPress Site. Following a tutorial I updated my files as follows:

functions.php

function register_my_menus() { register_nav_menus(     array(          'product-range' => __( 'Product Range' ),          'industry-types' => __( 'Industry Types' ),          'services' => __( 'Services' )      )  ); } add_action( 'init', 'register_my_menus' ); 

footer.php

<div class="container">             <div class="col-3" style="float:left"><h3>Product Range</h3> <?wp_nav_menu( array( 'footer' => 'product-range', 'container_class' => 'footer-menu' ) ); ?></div>             <div class="col-3" style="float:left"><h3>Industry Type</h3>                 <?wp_nav_menu( array( 'footer' => 'industry-type', 'container_class' => 'footer-menu' ) ); ?></div>             <div class="col-3" style="float:left"><h3>Services</h3>                 <?wp_nav_menu( array( 'footer' => 'services', 'container_class' => 'footer-menu' ) ); ?></div>             <div class="col-3" style="float:left"><h3>Address/Social Media Stuff</h3></div> </div> 

This worked fine on my local development machine — I ended up with additional menus in the CMS that I could add to as required. However when I uploaded my custom theme to the test server I saw the following where the menu should be:

product-range', 'container_class' => 'footer-menu' ) ); ?>

Can anybody tell me why this isn’t working here?

My woolentor custom page does not load on mobile

I have just successfully created my custom shop page using woolentor, and it loads perfectly on desktop. However, when I try to visit the same custom shop url on mobile device it redirects to homepage, and that’s all I get. This concerns me a lot since most users surf the internet on mobile device. Any help with this will be highly appreciated. Thank you, Michael

Would a custom table make more sense than a CPT in this case?

I am building a "multi vendor" type plugin to extend Woocommerce. There will be two types of new user roles: Vendor, and Non-Profit Org.

Vendors can list their products on the site, and users can choose at the checkout page which "Non-Profit Organization" they would like to donate part of their purchase to.

Ultimately, I would like the site owner to be able to have a curated list of all transactions, meaning how much is going to the Non Profit, how much goes to the Vendor. Preferably in chosen increments (monthly, daily, by individual order).

What’s got me stuck is figuring out how to let the "Vendor" and "Non Profit Org" accounts VIEW their respective transactions as well.

I don’t know if I should make two custom post types (Vendor Orders, Non Profit Orders) and just list extra info as Post Meta, as well as finding out a way to make sure ONLY the user assigned to the role can view orders for that role (in other words, one non profit can’t see records of another non profit).

Or, I am wondering if it makes more sense to create a custom table, which lists all valuable information (amount going to vendor, amount going to non profit, etc…) and just write custom queries to list the information based on the current user ID.

how to display image in custom post type from frontend form using advanced custom field?

here is my code: employeedetails.php

<div class="container submit-message">     <h1>Employee Form</h1>     <form id="enquiry_email_form" action="#" method="POST" data-url="<?php echo admin_url('admin-ajax.php'); ?>" enctype="multipart/form-data">     <div class="form-group">             <label for="">Enter Title</label>             <input type="text" class="form-control" name="title" id="title"/>         </div>         <div class="form-group">             <label for="">Enter Description</label>             <input type="text" class="form-control" name="description" id="description"/>         </div>         <div class="form-group">             <label for="">Enter Your Name</label>             <input type="text" class="form-control" name="post_name" id="post_name"/>         </div>         <div class="form-group">             <label for="">Enter Your Designation</label>             <input type="text" name="post_designation" id="post_designation" class="form-control"/>         </div>         <div class="form-group">             <label for="">Salary</label>             <input type="text" class="form-control" name="post_salary" id="post_salary"/>         </div>         <div class="form-group">             <label for="">Enter Joining Date</label>             <input type="date" class="form-control" name="post_date" value="<?php echo date('Y-m-d'); ?>" id="post_date"/>         </div>            <div class="form-group">             <label for="">Select Image</label>             <input type="file" id="post_img" name="post_img" src="<?php bloginfo('template_url'); ?>" value="" accept="image/*""/>         </div>         <div class="form-group">             <button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i> Submit</button>         </div>     </form> </div> 

$ (document).ready(function() { $ (“#enquiry_email_form”).on(“submit”,function(event){ event.preventDefault(); /* Clear result div $ (“#data”).html(”); */ var form= $ (this); var ajaxurl = form.data(“”); // var image = $ (‘#post_img’).prop(‘files’)[0]; var post_title = form.find(“#title”).val(); var post_description = form.find(“#description”).val(); var post_name = form.find(“#post_name”).val(); var post_designation = form.find(“#post_designation”).val(); var post_salary = form.find(“#post_salary”).val(); var post_date = form.find(“#post_date”).val(); var post_img = form.find(“#post_img”).val(); /*console.log(post_title); console.log(post_description); console.log(post_name); console.log(post_designation); console.log(post_salary); console.log(post_date); console.log(post_img);*/ /*if(detail_info.post_title === “” || detail_info.post_description === “” || detail_info.post_designation === “” || detail_info.post_salary === “” || detail_info.post_date === “” || detail_info.post_img === “”) { alert(“Fields cannot be blank”); return; }*/ $ (“.btn btn-primary”).text(‘submitting…’); $ .ajax({ url: “/wp-admin/admin-ajax.php”, type: ‘POST’, data: { action: ‘save_post_details_form_employee’, // this is going to be used inside wordpress functions.php post_title : post_title, post_description : post_description, post_name : post_name, post_designation : post_designation, post_salary : post_salary, post_date : post_date, post_img : post_img }, success: function(data) { //alert(“Insert Success”); //console.log(data); // Show successfully for submit message $ (“.submit-message”).html(‘Thank you for submitting’); } }); }); });

Custom post type paging return home page

I am having problem with Custom post type paging. Clicking on 2nd page of paging through back to home page. Permalinks flush/refreshed and i am using simple code to show custom post.

following is my code

$  cpt_type =  get_the_title(); $  paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $  custom_terms = get_terms('types'); $  args = array('posts_per_page' => 4, 'post_type' => $  cpt_type, 'paged' => $  paged, 'order', 'desc'/*, 'tax_query' => array( array('taxonomy' => 'type', 'field' => 'slug', 'terms' => $  custom_term->slug ))*/); $  customPostQuery = new WP_Query($  args); if($  customPostQuery->have_posts() ):     while($  customPostQuery->have_posts()) : $  customPostQuery->the_post();         global $  post;  <h4>Terms: <?php $  custom_term->name; ?></h4> <h3 class ="cq-h3"><a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a></h3> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a> <p><?php echo the_content(); ?></p>  endwhile;     function cpt_pagination($  pages = '', $  range = 4){         $  showitems = ($  range * 2)+1;         global $  paged;         if(empty($  paged)) $  paged = 1;         if($  pages == ''){             global $  wp_query;             $  pages = $  wp_query->max_num_pages;             if(!$  pages){                 $  pages = 1;             }         }         if(1 != $  pages){             echo "<nav aria-label='Page navigation example'>  <ul class='pagination'> <span>Page ".$  paged." of ".$  pages."</span>";             if($  paged > 2 && $  paged > $  range+1 && $  showitems < $  pages) echo "<a href='".get_pagenum_link(1)."'>&laquo; First</a>";             if($  paged > 1 && $  showitems < $  pages) echo "<a href='".get_pagenum_link($  paged - 1)."'>&lsaquo; Previous</a>";             for ($  i=1; $  i <= $  pages; $  i++){                 if (1 != $  pages &&( !($  i >= $  paged+$  range+1 || $  i <= $  paged-$  range-1) || $  pages <= $  showitems )){                     echo ($  paged == $  i)? "<li class=\"page-item active\"><a class='page-link'>".$  i."</a></li>":"<li class='page-item'> <a href='".get_pagenum_link($  i)."' class=\"page-link\">".$  i."</a></li>";                 }             }             if ($  paged < $  pages && $  showitems < $  pages) echo " <li class='page-item'><a class='page-link' href=\"".get_pagenum_link($  paged + 1)."\">i class='flaticon flaticon-back'></i></a></li>";             if ($  paged < $  pages-1 &&  $  paged+$  range-1 < $  pages && $  showitems < $  pages) echo " <li class='page-item'><a class='page-link' href='".get_pagenum_link($  pages)."'><i class='flaticon flaticon-arrow'></i></a></li>";             echo "</ul></nav>\n";         }     }     if (function_exists("cpt_pagination")) {         cpt_pagination($  customPostQuery->max_num_pages);     } 

kindly correct me where i’ve placed wrong code. my cpt is ‘lectures’