Change Emoji Appearance

The WP core reference lists the hooks and functions related to emoji. Here are the hooks you use to point to alternate versions of emoji.

How to recognize and remove malicious code on wordpress? [closed]

What this code can do actually in WordPress? This code allows arbitrary execution of PHP on your server. Deleting the file is enough to remove the problem? You’ll need to delete all files that contain backdoor like this. Look at every file on your system and compare it to the WordPress repository. In the last … Read more

Using jQuery to override the content of a div [closed]

In some instances, I’ll run a delayed init function in a setTimeout like this: var delay = setTimeout(function() { jQuery(“p.help-block.small”).html(“<p> … </p>”); }, 100); In the event that something is overwriting the html of that paragraph block on page load, this function will run 100 milliseconds after that, making yours the last change to the … Read more

Prevent other sites from showing my site via iframe

WordPress has a built-in function to send the X-Frame-Options header: send_frame_options_header(). It is used by default on the login and admin pages. If you want to enable it always, just add it for front end views: add_action( ‘template_redirect’, ‘send_frame_options_header’ ); But … it doesn’t send Content-Security-Policy headers. If you want to have a more complete … Read more

change position of element using hook [closed]

Instead of adding and removing the hooks like this. You should do the work on some action/hook. which gets fire before these hooks. so you can call it in this way add_action( ‘init’ , ‘sf_change_header_position’ , 10 ); function sf_change_header_position() { remove_action( ‘storefront_header’, ‘storefront_secondary_navigation’, 30 ); add_action( ‘storefront_header’, ‘storefront_secondary_navigation’, 52 ); }

Using variables as href in anchor tags (PHP) [closed]

It’s not really a WordPress related question, but it’s a simple one. The tribe_get_event_website_link() function you are using outputs a full link. You can use SimpleXML to extract the href part and then use it later. It’s as simple as this: $website = tribe_get_event_website_link(); $xml = new SimpleXMLElement( $website ); echo ‘<a href=”‘ . $xml[‘href’]. … Read more

meta_query in wp_query not working as expected

It is not working because there is a custom query in the events plugin that adds the posts to be ignored (not returned) when you run WP_Query. See getHideFromUpcomingEvents() method in the-events-calendar/src/Tribe/Query.php. But there is however a filter hook that you can use there to do whatever. See the following sample code: function wpse283031_hide_ids( $ids … Read more