How do I replace title with my plugin?

Please try this code hope it will solve your problem. add_filter( ‘wp_title’, ‘theme_custom_title’, 20 ); function theme_custom_title $title ) { return str_replace(‘your old title’, ‘your New title’, $title); } // changes the “Enter title here” to “Enter some New title” add_filter(‘gettext’, ‘custom_rewrites’, 10, 4); function custom_rewrites($translation, $text, $domain) { global $post; $translations = &get_translations_for_domain($domain); $translation_array … Read more

loop and in admin header problem

Move the query part to a separate function that returns the data you need: function rs_get_scripts_data(){ $array = array(); // query + add stuff to array return $array; } and use it with wp_localize_script like: $array = rs_get_scripts_data(); $myscript_vars = array( ‘array’ => $array ); wp_localize_script( ‘myscript’, ‘myscript’, $myscript_vars );

WordPress multiple user roles accessing on their information on one site?

You’ll need to combine some plugins and a couple of hooks. Apart from the role management, I’d recommend Adminimize: it’s quite powerful to clean up the dashboard based on user roles. And then: /** * When a registered user tries to visit a page for which he doesn’t have access, * i.e.: http:/example.com/wp-admin/plugins.php, * WordPress … Read more

Add query string variables to all hyperlinks URL matching a specified domain

Sorry I read your question wrong. You probably want to use WP_Rewrite and do something like: add_filter( ‘rewrite_rules_array’,’my_insert_rewrite_rules’ ); add_filter( ‘query_vars’,’my_insert_query_vars’ ); add_action( ‘wp_loaded’,’my_flush_rules’ ); // flush_rules() if our rules are not yet included function my_flush_rules(){ $rules = get_option( ‘rewrite_rules’ ); if ( ! isset( $rules[‘(argument_1=test&argument_2=test2)$’] ) ) { global $wp_rewrite; $wp_rewrite->flush_rules(); } } // … Read more

Inserting into WP DB

Use wp_cron to run a job every hour. http://codex.wordpress.org/Function_Reference/wp_cron Use $wpdb->get_results to fetch data from your external table. Example: $q = “SELECT * FROM my_table”; $results = $wpdb->get_results($q, OBJECT); foreach ( $results as $result) { } Insert new CPT-posts using wp_insert_post() http://codex.wordpress.org/Function_Reference/wp_insert_post

My first plugin doesn’t save the data in options

The problem is your validate function RSP_options_validate(). This function always a empty string. Check your conditional statement with preg_match. If you test your source without this functions, it works. register_setting( ‘RSP_options_group’, ‘RSP_options’, ‘RSP_options_validate’ ); to register_setting( ‘RSP_options_group’, ‘RSP_options’ );

How to apply order on custom taxonomy and custom meta key on custom post type

I think the simplest way would be to run the loop for each status and only output posts that match the current status: $statuses = array( ‘Active’, ‘Pending’, ‘Sold’ ); foreach( $statuses as $status ): echo $status; while( have_posts() ): the_post(); if( has_term( $status, ‘vr_listing_status’ ) ): the_title(); endif; endwhile; rewind_posts(); endforeach; A couple of … Read more