WooCommerce custom billing fields on email address

I finally got it to work using this code: I’m using a php class to make an organized workflow so don’t mind the public on functions… First I register my filters like this: public function registerFilters() { add_filter( ‘woocommerce_default_address_fields’, array($this, ‘woo_new_default_address_fields’), 10, 2); add_filter(‘woocommerce_order_formatted_billing_address’, array($this, ‘woo_custom_order_formatted_billing_address’), 10, 2); add_filter(‘woocommerce_formatted_address_replacements’, array($this, ‘myFunction’), 10, 2); add_filter(‘woocommerce_localisation_address_formats’, array($this, … Read more

Why can’t publish posts with too much text?

If you look into LONGTEXT documentation you’ll see that: The effective maximum length of LONGTEXT columns also depends on the configured maximum packet size in the client/server protocol and available memory. So I would say that 4GB support is only theoretical, in real life your server configuration wouldn’t allow operating on such a big chunk … Read more

How can a TinyMCE modal return formatted/visual text?

(Revised answer) You can use tinymce.DOM.encode() to convert all HTML tags to their entities, e.g. &lt; for < and &gt; for >: var html = tinymce.DOM.encode(e.data.code); Then to preserve trailing white-spaces: html = html.replace(/(^ +| +$)/gm, function(match, p1){ return p1.replace(/ /g, ‘&nbsp;’); }); And this to convert all line breaks to <br>: html = html.replace(/(?:\r\n|\r|\n)/g, … Read more

How to perform action when plugin/theme editor is used?

The ajax action that runs on theme or plugin update is edit-theme-plugin-file so you should be able to hook into it by running code on the wp_ajax_edit-theme-plugin-file hook. add_action(‘wp_ajax_edit-theme-plugin-file’, ‘log_cowboy_coders’); function log_cowboy_coders() { $user = get_current_user_id(); if (!empty($__POST[‘theme’])) { // Log that someone is editing a theme } else if (!empty($__POST[‘plugin’])) { //log that someone … Read more

Where do I go to edit this area? [closed]

Welcome to the site 🙂 Since you already know that the item you want to change is in framework/legacy/cranium/headers/views/global/_navbar.php then the matter of changing it is very easy and straightforward. First: Create a child theme (if you haven’t already). A child theme will allow you to change just the things you want while preserving the … Read more

Access post title from custom meta box on title change

The event listener you have added will only attach to the available .editor-post-title__input elements, and won’t attach to any dynamically added elements. You are better to move the listener to the body as follows: jQuery(‘body’).on(‘keyup’, ‘.editor-post-title__input’, function(event){ console.log(jQuery(this).val()); }); Given the admin area is moving to use more React components, it’s a good habit to … Read more

Unable to edit and see content of pages

Yes this is most certainly an issue with your theme then. To figure out what the error is (assumption is it’s a JavaScript error), right click anywhere on the page, and then select Inspect This will open the developer tools window, click on the Console tab, and then refresh the page. You should see some … Read more

Is it possible to remove editor from a custom product type?

Yes, You can disable the default editor by removing ‘editor’ from the supports attribute array for register_post_type( ‘product’, $args ) ‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘comments’, ‘custom-fields’ ), Change this to somthing like this ‘supports’ => array( ‘title’, ‘thumbnail’, ‘comments’, ‘custom-fields’ ), You can read wordpress function reference for register_post_type to learn more about … Read more

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