Articles of replace

Function to replace comment's accented characters before posting

I have some weird problems with encoding my WordPress website and I can’t add comments with accent words. when i try to do it, i received error by WP. What i need is just a function that read the comment before it has inserted and transforms all the accented characters with normal characters with no […]

Can't add classes using jQuery from a JSON string with get_body_class()

In order to refresh the classes on the <body>element after an AJAX call, I am writing at the top of my AJAX response the following in JSON: $o[ ‘classes’ ] = get_body_class(‘project’); I can then see in the JSON response the following: “classes”:[“single”,”single-project” ,”postid-1793″,”logged-in”,”project”,”default”] What I am trying to do is to put all those […]

how to replace old DW site with new WP site?

I’m new to I have an old Dreamweaver website that I want to replace with my new site, using my same original URL. How do I do this? I need simple, easy-to-understand explanations, if possible, as I’m not very tech-savvy. Thank you in advance for your help.

Wp Admin Bar Customizing Labels

I would like to replace the Label the Plugin WP Custome Area sets on the admin bar. This is the initial parto of code that sets the menu title: public function build_adminbar_menu($wp_admin_bar) { $wp_admin_bar->add_menu(array( ‘id’ => ‘customer-area’, ‘title’ => __(‘WP Custome Area’, ‘cuar’), ‘href’ => admin_url(‘admin.php?page=wpca’) )); This is the hook i tried but without […]

Problem with images URL after filter applying

I have this code in my functions.php file: function user_content_replace($content) { // it’s not a URL, let’s apply the replacement if (!filter_var($string, FILTER_VALIDATE_URL)) { $replacement = ‘$1.</p><p>$2’; return preg_replace(“/([^\\.]*\\.[^\\.]*\\.[^\\.]*){1}\\.([^\\.]*)/s”, $replacement, $content); } else { // it’s a URL, just return the string return $content; } } add_filter(‘the_content’,’user_content_replace’, 99); This code replaces every third dot in […]

Replace plugin function with a custom function?

How can I replace a function from a plugin with a custom version of it. The original function of the plugin is: function sep_get_the_event_end_date($post = NULL) { $post = get_post($post); if ($post->post_type !== ‘event_listing’) { return; } $event_xml = get_post_meta(get_the_ID(), ‘event_meta’, TRUE); $xml_object = new SimpleXMLElement($event_xml); $end_date = isset($xml_object->end_date) ? $xml_object->end_date : ”; $event_date = […]

Replace dynamically content in a custom database table when a custom post is created

I use a third party plugin that saves events locations addresses as a custom locations post type in a separate table – wp_em_locations. Because events are created by multiple authors, they write sometimes differently the name of the same town, using different languages. How can I filter dynamically that names when the post is created […]

Can I change the “Home” text in the menu?

I’m pretty sure this can be done with a filter or some kind of find and replace, but I’m not sure how. I have a page called “Home” like so: When the link is displayed in my template it says “Home”. I’d like it to say “About Us”. I want the user to know which […]

is wpdb->replace() already sanitized?

i am working on a plugin that includes table in database that holds information from the different posts. right now i use $wpdb->replace(), so whenever a post is being created or updated it is also create a new row in my table or update one that is already exist. my questions are: is replace() already […]

Replace the slug of parent pages with #

I’m creating a WordPress site with a Superfish CSS3 / Jquery dropdown menu, complete with hoverIntent as displayed here: As far as I can see, this menu works well on mobile devices, because the link values refer to the same page, like #a, so that clicking a link does not cause the page to […]