• 0

set blogdescription and blogname from pagelines dms front end admin panel


Question

Posted · Report post

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!

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0

Posted · Report post

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 ?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now