LLMS_Meta_Box_Certificate
Certificate template meta box class.
Source Source
File: includes/admin/post-types/meta-boxes/class.llms.meta.box.certificate.php
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | class LLMS_Meta_Box_Certificate extends LLMS_Admin_Metabox { /** * Configure the metabox settings. * * @since 3.0.0 * @since 6.0.0 Renamed from "Certificate Settings" to "Settings". * Moved to the side context with default priority. * * @return void */ public function configure() { $this ->id = 'lifterlms-certificate' ; $this ->title = __( 'Settings' , 'lifterlms' ); $this ->screens = array ( 'llms_certificate' , ); $this ->priority = 'default' ; $this ->context = 'side' ; $this ->callback_args = array ( '__back_compat_meta_box' => true, ); } /** * Builds array of metabox options. * * Array is called in output method to display options. * Appropriate fields are generated based on type. * * @since 1.0.0 * @since 3.17.4 Unknown. * @since 3.37.12 Allow the certificate title field to store text with quotes. * @since 6.0.0 Remove the background image option (in favor of featured image metabox). * Expose the "Next Sequential ID" option. * * @return array Array of metabox fields. */ public function get_fields() { $next_id = llms_get_certificate_sequential_id( $this ->post->ID ); $fields = array ( array ( 'label' => __( 'Certificate Title' , 'lifterlms' ), 'id' => $this ->prefix . 'certificate_title' , 'type' => 'text' , 'class' => 'input-full' , 'desc_class' => 'd-all' , 'sanitize' => 'no_encode_quotes' , ), array ( 'label' => __( 'Next Sequential ID' , 'lifterlms' ), 'id' => $this ->prefix . 'sequential_id' , 'type' => 'number' , 'class' => 'input-full' , 'desc_class' => 'd-all' , 'value' => $next_id , 'min' => $next_id , 'step' => 1, ), ); return array ( array ( 'title' => __( 'General' , 'lifterlms' ), 'fields' => $fields , ), ); } } |
Expand full source code Collapse full source code View on GitHub
Methods Methods
- configure — Configure the metabox settings.
- get_fields — Builds array of metabox options.
Changelog Changelog
Version | Description |
---|---|
3.37.12 | Allow the certificate title field to store text with quotes. |
1.0.0 | Introduced. |