Changing the HTML of notices in WooCommerce [closed]

After talking with some of the WooCommerce people on Slack, I realized that the problem here is probably this pattern, in frontend/cart.js – due to the fact, that my store uses the AJAX functionality that WooCommerce provides. var show_notice = function( html_element, $target ) { if ( ! $target ) { $target = $( ‘.woocommerce-notices-wrapper:first’ … Read more

How $_GET[‘updated’] variable is passed when updating a user?

I have found a javascript solution. Here is the code: member.js (needs jQuery) $jq = jQuery.noConflict(); $jq(document).ready(function () { redirect_on_save_func(); }); function redirect_on_save_func() { var qvars = get_query_func(); var nq = []; $jq.each(qvars, function (vk, vv) { if (vk.match(‘meta_warning*’) == null) nq.push(vk + ‘=’ + encodeURIComponent(vv)); }); var hr = window.location.href; var nqs = hr.split(‘?’)[0] … Read more

Trying to get property of non-object wordpress error message

Given that the page works if you leave the original query alone, your solution is pretty simple. Leave the original query alone. You don’t need to overwrite that query in order to created secondary loops. Instead of this: query_single(‘dealers’, ‘publish’, ‘1’, $taxtype, $value); if (have_posts()) : while (have_posts()) : the_post(); You want: $myq = new … Read more

wp_get_http has been deprecated. Use WP_Http instead

WP_Http is a: Core class used for managing HTTP transports and making HTTP requests. so it should most likely be this link: https://developer.wordpress.org/reference/classes/wp_http/ instead of: https://developer.wordpress.org/reference/functions/WP_Http that redirects you to: https://developer.wordpress.org/reference/functions/wp_http_supports/ Then there are wrappers like wp_remote_get(), wp_remote_post(), wp_safe_remote_get(), wp_safe_remote_post(), wp_remote_retrieve_response_code(), download_url(), … etc, that makes it easier to use. Check out e.g. the HTTP … Read more

wp_new_comment requires author url and author email

The example from the codex, the array of argument is now required. global $post, $current_user; //for this example only 🙂 $commentdata = array(‘comment_post_ID’ => $post->ID, // to which post the comment will show up ‘comment_author’ => ‘Another Someone’, //fixed value – can be dynamic ‘comment_author_email’ => ‘[email protected]’, //fixed value – can be dynamic ‘comment_author_url’ => … Read more

Dynamically set taxonomy term and show admin notice on post save

Okay, so just in case anyone needs help on the same thing I did… here is my solution. Instead of a php/wordpress solution, I used javascript. Id love to see the php/wordpress solution if someone wants to post it. <?php // Admin Custom JS add_action(‘admin_head’, ‘admin_custom_js’); function admin_custom_js() { ?> <script> // update date (month) … Read more

Problem with display data from get_option

You inserting the value of the get_option(‘go_to_top_or_bottom’);as a property in the $this->options so when you actual try to print it like this print_r($this->options[‘turn_on’]);you get the index error because this is a property!!! Correct way will be $this->options[‘turn_on’]=get_option(‘go_to_top_or_bottom’); Update I see that the $options is a private meaning you cannot access it outside of the class. … Read more

admin notice on Insert Media popup screen

I’m unaware of any hooks that tap in in the pop up, but there might be. If not, you could use some jQuery to put your message on the pop-up when Add Media is clicked. I was able to with the following: add_action(‘admin_head’,’myplugin_add_media_popup_notice’); function myplugin_add_media_popup_notice() { ?> <script> jQuery(window).load(function() { // the MEDIA buttons you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)