LLMS_Settings_Engagements::get_settings_group_certs()

Retrieve fields for the certificates settings group.


Return Return

(array[])


Top ↑

Source Source

File: includes/admin/settings/class.llms.settings.engagements.php

	protected function get_settings_group_certs() {

		$certificate_sizes = llms_get_certificate_sizes();

		$settings = array(
			array(
				'title'    => __( 'Placeholder Background Image', 'lifterlms' ),
				'desc'     => $this->get_award_image_desc( __( 'certificate', 'lifterlms' ) ),
				'id'       => 'lifterlms_certificate_default_img',
				'type'     => 'image',
				'value'    => llms()->certificates()->get_default_image( 0 ),
				'autoload' => false,
			),
			array(
				'title'    => __( 'Default Size', 'lifterlms' ),
				'desc'     => __( 'The default size used when creating new certificates.', 'lifterlms' ),
				'id'       => 'lifterlms_certificate_default_size',
				'type'     => 'select',
				'options'  => $this->get_certificate_size_opts(),
				'default'  => 'LETTER',
				'autoload' => false,
			),
			array(
				'title' => __( 'User Defined Certificate Size', 'lifterlms' ),
				'desc'  => __( 'Use these settings to customize the User Defined Certificate size.', 'lifterlms' ),
				'id'    => 'cert_user_defined_size_settings',
				'type'  => 'subtitle',
			),
			array(
				'title'             => __( 'Width', 'lifterlms' ),
				'id'                => 'lifterlms_certificate_default_user_defined_width',
				'type'              => 'number',
				'default'           => $certificate_sizes['USER_DEFINED']['width'],
				'autoload'          => false,
				'custom_attributes' => array(
					'step' => '0.01',
				),
			),
			array(
				'title'             => __( 'Height', 'lifterlms' ),
				'id'                => 'lifterlms_certificate_default_user_defined_height',
				'type'              => 'number',
				'default'           => $certificate_sizes['USER_DEFINED']['height'],
				'autoload'          => false,
				'custom_attributes' => array(
					'step' => '0.01',
				),
			),
			array(
				'title'    => __( 'Unit', 'lifterlms' ),
				'id'       => 'lifterlms_certificate_default_user_defined_unit',
				'type'     => 'select',
				'options'  => $this->get_certificate_units_opts(),
				'default'  => $certificate_sizes['USER_DEFINED']['unit'],
				'autoload' => false,
			),
		);

		if ( $this->has_legacy_certificates() ) {

			$settings = array_merge(
				$settings,
				array(
					array(
						'title' => __( 'Legacy Certificate Background Image Settings', 'lifterlms' ),
						'type'  => 'subtitle',
						'desc'  => __( 'Use these settings to determine the dimensions of legacy certificate background images created using the classic editor. These settings have no effect on certificates created using the block editor. After changing these settings, you may need to <a href="http://wordpress.org/extend/plugins/regenerate-thumbnails/" target="_blank">regenerate your thumbnails</a>.', 'lifterlms' ),
						'id'    => 'cert_bg_image_settings',
					),
					array(
						'title'    => __( 'Image Width', 'lifterlms' ),
						'desc'     => __( 'in pixels', 'lifterlms' ),
						'id'       => 'lifterlms_certificate_bg_img_width',
						'default'  => '800',
						'type'     => 'number',
						'autoload' => false,
					),
					array(
						'title'    => __( 'Image Height', 'lifterlms' ),
						'id'       => 'lifterlms_certificate_bg_img_height',
						'desc'     => __( 'in pixels', 'lifterlms' ),
						'default'  => '616',
						'type'     => 'number',
						'autoload' => false,
					),
					array(
						'title'    => __( 'Legacy compatibility', 'lifterlms' ),
						'desc'     => __( 'Use legacy certificate image sizes.', 'lifterlms' ) .
										'<br><em>' . __( 'Enabling this will override the above dimension settings and set the image dimensions to match the dimensions of the uploaded image.', 'lifterlms' ) . '</em>',
						'id'       => 'lifterlms_certificate_legacy_image_size',
						'default'  => 'no',
						'type'     => 'checkbox',
						'autoload' => false,
					),
				)
			);

		}

		return $this->generate_settings_group(
			'certificates_options',
			__( 'Certificate Settings', 'lifterlms' ),
			'',
			$settings
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Add background image options. Only load legacy certificate options when the legacy option is enabled.
3.37.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.