Jump to content


Photo
- - - - -

set blogdescription and blogname from pagelines dms front end admin panel

site name admin blogname blogdescription dms

  • Please log in to reply
2 replies to this topic

#1 respectgb

respectgb

    Newbie

  • Members

  • 6 posts
  • LocationSouth Yorkshire
  • Country: Country Flag

Posted 18 October 2013 - 09:37 AM

Hi,

 

Hopefuly someone here can help me on my quest, I have managed to add an admin panel under the "global options" for my clients to use for extended options and also remove any elements that I don't want them to see based on their user level (all is great so far).

 

However, what I'm wanting them to be able to edit is the 'blogname' and 'blogdescription' for their sites, I have managed to get the 'blogname' and 'blogdescription' to interact (clear the fields in the dabase - argh!) using the following action, but it doesn't actually take into account the $settings array that I have created.

 
add_action( 'pl_sorted_settings_array', 'save_extra_blog_options' );

function save_extra_blog_options( $settings ) {

    update_option( 'blogname', $_POST['blogname'] );
    update_option( 'blogdescription', $_POST['blogdescription'] );
}

I have copied and pasted the code that I am using to create the admin panel below:

 
add_filter('pl_sorted_settings_array', 'add_global_panel2');
function add_global_panel2($settings){
    $settings['privacy'] = array(
        'name' => 'Blog Name',
        'icon' => 'icon-eye-open',
        'opts' => array(
            // Regular Options Engine
            array(
    		'id' => 'blogname',
  		'type' => 'text',
                'label' => 'blog Name',
	    ),
            // Regular Options Engine
            array(
                'id'   => 'blogdescription',
  		'type' => 'text',
                'label' => 'blog description',
            ),
        )
    );
    // Finally we return the new array
    return $settings;
}

Really hope you guys can help!!

 

Thanks in advance!



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 12977 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 18 October 2013 - 11:53 AM

Hi,

Are you referring to the Wordpress Administrator Dashboard > Settings > General > Site Title and Site Description ?

If so, why are not just allow them to change the options ?



#3 respectgb

respectgb

    Newbie

  • Members

  • 6 posts
  • LocationSouth Yorkshire
  • Country: Country Flag

Posted 18 October 2013 - 02:56 PM

Danny,

 

Thanks for the prompt response!

 

Yes, I'm referring to the same settings that you mentioned, the reason that I want to add this to the front end is; that I'm setting up a site for a client so that it will not require them to ever visit the wp-admin dashboard as there is no need for posts or page content in my setup (just using pagelines sections for various content blocks) on predefined pages.

 

Thus I'm wanting to make the admin experience for them on the frontend only, and this is one feature that they have requested that they should be able to change as they wish.

 

Hope this all makes sense.

 

Thanks

 

Luke







Also tagged with one or more of these keywords: site name, admin, blogname, blogdescription, dms