No results found. Try again with different words?

Search must be at least 3 characters.

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 article helpful?


Did not find a solution? We are here to help you succeed.

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' );

Leave a Reply

Your email address will not be published. Required fields are marked *

LET’S GET STARTED

Ready to Give It a Try?

Start Your Free 14-Day Trial Now. No Obligation. No Reason Not To.

Trial Icon

14 Days Free Trial

Experience Our Platform Risk-Free

Docs Icon

Documentation

Articles that cover common questions

24/7 World Class Support Team

Friendly Support

Reach Out – We’re Here to Help

Scroll to Top