- Display a dialog when user approves an image
- Changing A Mockup URL Slug
- Extend Backbone Models, Views, Collections
- Adding Custom Scripts and Styles
- ph_website_publish_thread
- New Comment Threads
- Add additional notification emails
- 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
- How to Install SureFeedback & Addons
- How to Update SureFeedback
- Should I Install SureFeedback on My Main Site or a Dedicated Installation?
- Caching and SureFeedback
- Dashboard Shortcode
- Adding A Project Shortcode To Your Site 3.1.x and lower
- Project Shortcode
- Hosting
- Cloudways Compatibility
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