What is the difference between get_page_link and get_permalink functions?

When i explored the WordPress core for this answer i found that get_permalink() function internally calls get_page_link() function for getting permalink of page and it calls get_post_permalink() function to get permalink of post. Therefore either you use get_permalink() function or get_page_link() function, you will get same result. The difference between these two is get_page_link() function … Read more

Add custom template page programmatically

The article linked is on the right track, but i’ll make it more simple for you.. 😉 add_filter( ‘page_template’, ‘catch_plugin_template’ ); function catch_plugin_template( $template ) { if( ‘tp-file.php’ == basename( $template ) ) $template = WP_PLUGIN_DIR . ‘/yourpluginname/tp-file.php’; return $template; } The filter basically looks to see if your special page template is set for … Read more

What is this code in my theme’s functions.php? if (isset($_REQUEST[‘action’]) && isset($_REQUEST[‘password’])

Your website has been hacked. This is malicious code that gets triggered from the outside, loading more malicious content from ‘www.dolsh.cc’ domain. If the content comes back after you remove it, then you have hacked files somewhere else that will automatically rewrite functions.php any time page is loaded. You need to find and clean up … Read more

Import WordPress XML File from Within Functions.php

Your question is a bit specific if you “only” want to automatically import some posts/pages. There are other ways to do this then using a XML export file. If you have text-only posts, then you should use LOAD DATA INFILE. At first you have to export your posts. global $wpdb, $wp_filesystem; $tables = array( ‘posts’ … Read more

Is it possible to rename a post format?

I think this is the only way for now. Put this in your functions.php in your theme folder or create a simple plugin: function rename_post_formats( $safe_text ) { if ( $safe_text == ‘Aside’ ) return ‘Quick’; return $safe_text; } add_filter( ‘esc_html’, ‘rename_post_formats’ ); //rename Aside in posts list table function live_rename_formats() { global $current_screen; if … Read more