WordPress.org

Ready to get started?Download WordPress

Forums

WPMU Prefill Post
More and more backslashes are created (1 post)

  1. dagobert24
    Member
    Posted 2 years ago #

    Hi,

    great Plugin.
    I encountered a problem with templates containing quotes. After having a look into the source code, I realized the problem. When adding a Template or updating it, you use the function addslashes. Theses slashes are never removed. Additionally, you do not need to use the function at all, because wordpress does the magic by itself, when writing ti the database.
    I added the fixed code at the end.

    I hope, you can release an update soon,
    Cheers

    public function updateTemplate($id,$post_title,$post_content,$post_excerpt){
    
    ...
    
    			return $wpdb->update($table_name, array('post_title' => $post_title,
    													'post_content' => $post_content,
    													'post_excerpt' => $post_excerpt
    											), array('ID' => $id),array('%s','%s','%s'), '%d');
    
    		}
    		public function addTemplate($post_title,$post_content,$post_excerpt){
    
    .....
    			return $wpdb->insert($table_name, array('post_title' => $post_title,
    													'post_content' => $post_content,
    													'post_excerpt' => $post_excerpt,
    													'post_author' => $user_ID
    											), array('%s','%s','%s','%d'));

    http://wordpress.org/extend/plugins/wpmu-prefill-post/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic