- Display a dialog when the user approves an image
- Changing A Mockup URL Slug
- Extending Backbone Models, Views and Collections
- Adding Custom Scripts and Styles
- ph_website_publish_thread
- New Comment Threads
- Add additional notification emails
- Display a welcome message for new users on mockup projects
- Change the subscribed user email based on a role
- Display a dialog when the user submits a comment
- Auto-Close Mockup Comment After New Comment
- Changing the mockup download
- Add Settings To Extensions Page
- Listening for Javscript Events
- Change default mockup project options
- Overriding and Changing Templates
Add Settings To Extensions Page
To add settings for your extension, you can add these right to the extensions tab of the SureFeedback settings. There’s a neat filter that lets you do this called ph_settings_extensions. Here’s an example:
<?php
// filter plugin settings
add_filter( 'ph_settings_extensions', 'my_extension_plugin_settings' );
// add our settings
function my_extension_plugin_settings($settings) {
// add fields
// divider with title
$settings['fields'][] = array(
'id' => 'highlight_divider',
'label' => __( 'JIRA Integration', 'my-text-domain' ),
'description' => '',
'type' => 'divider',
);
// see all field types in includes/admin/settings/settings-fields.php
// text box example
$settings['fields'][] = array(
'id' => 'my_extension_text_box',
'label' => __( 'A Text Box', 'my-text-domain' ),
'description' => __( 'This is a description for a text box.', 'my-text-domain' ),
'type' => 'text',
'default' => '',
'placeholder' => __( 'Enter some text.', 'my-text-domain' ),
);
// color picker
$settings['fields'][] = array(
'id' => 'my_extension_color',
'label' => __( 'Color Picker Example', 'project-huddle' ),
'description' => __( 'Color picker description.', 'project-huddle' ),
'type' => 'color',
'default' => '#23282d'
),
// checkbox example
$settings['fields'][] = array(
'id' => 'my_extension_checkbox',
'label' => __( 'Checkbox Example', 'project-huddle' ),
'description' => __( 'Checkbox description.', 'project-huddle' ),
'type' => 'checkbox',
'default' => 'on', // on by default
);
return $settings;
}
/**
* Get our options
*/
$text_box = get_option('ph_my_extension_text_box');
$color = get_option('ph_my_extension_color');
$checkbox = get_option('ph_my_extension_checkbox');
Then to get your options, use the get_option function with the “ph_” prefix.
Was this doc helpful?
What went wrong?
We don't respond to the article feedback, we use it to improve our support content.
On this page