- 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
Change default mockup project options
You can set default options for new mockup projects using the ph_project_meta_box_options filter. This will let you set specific defaults for projects when you create new mockup projects. This will not affect your existing projects, only defaults for newly created mockup projects.
Here’s how you’d set those defaults with a filter. You’ll likely add this to your theme or child theme’s functions.php file and modify the ‘on’ or ‘off’, and ‘public’ values as necessary:
<?php
/**
* Set defaults for new mockup projects
*
* @param $options array Meta box options
*
* @return array Filtered options
*/
function wp_928_mockup_project_defaults( $options ) {
foreach ( $options as $key => $option ) {
switch ( $option['id'] ) {
case 'project_access':
$options[ $key ]['default'] = 'public'; // login, password or public
break;
case 'project_comments':
$options[ $key ]['default'] = 'on'; // on or off
break;
case 'project_sharing':
$options[ $key ]['default'] = 'on'; // on or off
break;
case 'retina':
$options[ $key ]['default'] = 'on'; // on or off
break;
case 'project_download':
$options[ $key ]['default'] = 'on'; // on or off
break;
case 'zoom':
$options[ $key ]['default'] = 'on'; // on or off
break;
case 'project_approval':
$options[ $key ]['default'] = 'on'; // on or off
break;
case 'project_unapproval':
$options[ $key ]['default'] = 'on'; // on or off
break;
}
}
return $options;
}
add_action( 'ph_project_meta_box_options', 'wp_928_mockup_project_defaults' );
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