Is there a way to know if a post has been published through XML-RPC?

You could use a custom field for a post which is saved via XMLRPC by using the action hook xmlrpc_publish_post. wpse_from_xmlrpc() could than check this custom field. <?php add_action( ‘xmlrpc_publish_post’, ‘add_xmlrpc_postmeta’ ); function add_xmlrpc_postmeta( $post_id ){ update_post_meta( $post_id, ‘send-by-xmlrpc’, 1 ); } function wpse_from_xmlrpc( $post_id ){ $xmlrpc = get_post_meta( $post_id, ‘send-by-xmlrpc’, true ); if( $xmlrpc … Read more

PHP library that can merge stylesheet with inline style [closed]

I am trying to replicate the same output you have provided in your example above and I am only able to achieve output along the lines of; <p class=MsoNormal> <span class=MsoIntenseReference> <span style=”color:red;text-transform:none;letter-spacing:0pt;font-weight:normal;text-decoration:none”> Red Example text </span> </span> </p> As you can see Microsoft Word (2010) is inserting predefined class names for the paragraph and … Read more

Storing an XML Response (Transient)?

According to this ticket: Cannot serialize object wrapping 3rd party library structs. Must serialize the xml (to a string) and store that to session and reload the xml when restoring from session When you are storing object in transient it gets serialized and not all objects are capable of that correctly. Store textual XML data … Read more

Best way for plugin to accept POSTs?

One option is to use the add_rewrite_endpoint technique I mention in my comment. Another option is to use the admin_post_{action} hook. For example, you can POST data to your URL with an action GET parameter: http://www.example.com/wp-admin/admin-post.php?action=my_plugin_action Then hook that action via admin_post_nopriv_my_plugin_action to receive that request and process the data: function wpd_my_plugin_action() { status_header(200); // … Read more

Simply deleting XMLRPC file

You shouldn’t delete that file – it will be restored after update – so deleting it makes no sense (and it shouldn’t be treated as security fix). You can disable XMLRPC using filter: add_filter(‘xmlrpc_enabled’, ‘__return_false’); And even block access to that file. Below code for Apache (sandrodz showed code for nginx): <Files xmlrpc.php> Order deny,allow … Read more

Restrict access to xmlrpc.php

There are plugins for that: e.g. http://wordpress.org/plugins/disable-xml-rpc/ You can also write a filter yourself add_filter(‘xmlrpc_enabled’, ‘__return_false’); You can simply add this code your theme functions.php (located in wp-content/themes/your_theme). However, you are advised to create a child theme (http://codex.wordpress.org/Theme_Development) so that your modification does not disappear when you update the theme. Alternatively, you can create your … Read more

Removing unnecessary wordpress files

If you don’t use any 3rd services such as XMLRPC | REST API | oEmbed | Windows Live Writer, removing those lines/headers doesn’t affect anything to your site. Those lines of code is the best way to archive what you want. To remove xmlrpc.php?rds, you need another line: remove_action(‘wp_head’, ‘rsd_link’); Put all of them in … Read more

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