Articles of functions

function to erase swear words

Does anyone use a function that will just not print swear words? We don’t have any, and we edit for them, but in giving more writers more publishing privileges, it could lead to a situation with swear words. I’d rather just not print the words, possibly.

Converting html to wordpress images not showing

I am trying to convert a html page to wordpress but I am stuck on a few issues. Images I add to gallery and try to display on the pages don’t appear. Slideshow doesn’t appear. Note:If I use the wp default themes like twenty fourteen the above appear. I have tried using the default gallery,wp […]

wp_dropdown_categories and custom attribute

I’m using this jQuery plugin to handle select element on my site: bootstrap-select Unfortunately, I can’t found any option which allow me add a custom attribute to the select element, for e.g: I want my dropdown look like this: <select class=”dropdown” data-live-search=”true”> … </select> Is there any chance for me?

PHP code inside shortcodes

Basically, I have this line of code: <?php echo do_shortcode(‘[O_U user_name=”operator” blocked_message=”This page is restricted for guests.”] **Content Goes here** [/O_U]’); ?> Now, inside Content Goes here I use regular HTML to create my content. But, now, I need to add some php inside that HTML. Right now, I need to populate the option for […]

Gravity Forms – Using a Form to Pre-populate A Gravity Form

I have a custom form (hardcoded, not a GF) on one page I’ve written myself: <form id=”tailor-select” method=”POST”> <ul> <li> <ul> <li> <input name=”input_9.1″ type=”checkbox” value=”Cover Design” id=”choice_2_9_1″ tabindex=”1″> <label for=”choice_2_9_1″ id=”label_2_9_1″>Cover Design</label> </li> <li> <input name=”input_9.2″ type=”checkbox” value=”Artwork Creation” id=”choice_2_9_2″ tabindex=”2″> <label for=”choice_2_9_2″ id=”label_2_9_2″>Artwork Creation/Redrawing/Relabelling <a rel=”#artwork” href=”javascript:void(0);”>read more ></a></label> </li> <li> <input name=”input_9.3″ […]

Set the transport of the Customizer 'header_image' core setting to 'postMessage'

To activate the Customizer core section Navigation (ID: nav), you need to: add_theme_support( ‘custom-header’ ); I already tried to make the transport of the Customizer header_image setting postMessage with the ID based on what I’m seeing at get_header_image(): function theme_customize_register( $wp_customize ) { $wp_customize->get_setting( ‘header_image’ )->transport = ‘postMessage’; // I also tried this line. // […]

Retrieve contents/page names of various pages for use in a plugin

I’m trying to design a plugin that retrieves the contents of user selected pages and copy the contents into a giant single page. (As long single page websites are trendy right now) These are the following functions I need to either find or build: Get list of page names in database. Get contents of the […]

Adding multiple taxonomy filters to functions.php

I need to add multiple taxonomy filters to the functions.php file to remove (3) irrelevant taxonomies from the Yoast SEO sitemap index. I have been able to successfully add one filter, but when I add the other two filters, I keep getting a 500 server error. I should note that I am a novice when […]

How does WordPress process plugin installations?

Please consider that I am not a WordPress plugin developer, but I am maintaining a lot of WordPress websites. In case I have to perform a change to all of them, I will have to log in each site and this is consuming a lot of time. To resolve the problem, I devlop my own […]

wpautop – disable <br> tags, keep <p> tags

I write My articles in Emacs and they end up having tons of newlines, with double newlines to separate paragraphs. Ideally, I want wordpress to work like markup does, meaning it ignores single line breaks but adds paragraphs when a double newline is met. Unfortunately, disabling wpautop makes WordPress ignore both single and double newlines. […]