Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the Pagelines DMS Theme and I'm wanting to extend the functionality of the front end admin panel. The user(s) I'm building this for would like to be able to edit a few settings directly from this page, including of which - the Site Title and Tagline.

Concept: enter image description here

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', 'pagelines')
    ),
        // Regular Options Engine
        array(
        'id' => 'blogdescription',
    'type' => 'text',
           'label' => __('blog description![enter image description here][1], 'pagelines')
        ),
    )
);
// Finally we return the new array
return $settings;
}

Is there a way to do this (add their own Site Title and Taglines) within a text-field for example, click Publish Options button to output it to the front-end of the site and display an updated version in the WP API Settings > General Settings sub-menu page?

share|improve this question
1  
This seems very specific to the extension. Please try to provide links to relevant code and this might be better aimed at developer's support. –  Rarst Oct 16 '13 at 8:20
    
    
    
Rarst - I have tried the developer support forums and they are proving to be of no help in the matter. Fingers crossed someone on here can point me in the right direction. & thanks for getting back to me! –  Luke Oct 23 '13 at 23:01

1 Answer 1

Ok,

So I have found a solution to my problem;

Pagelines encodes each key and value pair into a json string, within in its own option called pl_settings in the wp_options table.

They also give you access to each of these key->value pairs using the following: $value = pl_setting('option_key')

Thus I have taken the approach of using the following code to fulfil my needs:

add_filter('pl_sorted_settings_array', 'add_global_panel2');
function add_global_panel2($settings){
    $settings['privacy'] = array(
        'name' => 'About Your Loved One',
        'icon' => 'icon-heart',
        'opts' => array(
            // Regular Options Engine
        array(
                'key' => 'blogname',
                'type' => 'text',
                'label' => 'the name of your loved one',
                'help' => 'test'
        ),
            // Regular Options Engine
            array(
                'key'   => 'blogdescription',
                'type' => 'text',
                'label' => 'a message to your loved one',
                'help' => 'test'
            ),
        )
    );
    update_option('blogname', $value = pl_setting('blogname'));
    update_option('blogdescription', $value = pl_setting('blogdescription'));
    // Finally we return the new array
    return $settings;
}

The only downside of working it in this way is that I need to refresh the browser twice once updating either of the values for it to actually take effect on it's corresponding option.

If anyone could better this then please let me know.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.