public function register_page() { $podcast = \Podlove\Model\Podcast::get(); $form_attributes = array('context' => 'podlove_podcast', 'action' => $this->get_url()); ?> <p> <?php echo __('These are the three most important fields describing your podcast. <strong>Title</strong> is the title of the podcast that is the primary field to be used to represent the podcast in directories, lists and other uses. The <strong>subtitle</strong> is an extension to the title. The subtitle is meant to clarify what the podcast is about. While a title can be anything, a subtitle should be more descriptive in what the content actually wants to convey and what the most important information is, you want everybody want to know about the offering. A <strong>summary</strong> is a much more precise and elaborate description of the podcast\'s content. While title and subtitle are rather concise, a summary is meant to consist of one or more sentences that form a paragraph or more.', 'podlove'); ?> </p> <?php \Podlove\Form\build_for($podcast, $form_attributes, function ($form) { $wrapper = new \Podlove\Form\Input\TableWrapper($form); $podcast = $form->object; $wrapper->string('title', array('label' => __('Title', 'podlove'), 'html' => array('class' => 'regular-text required podlove-check-input'))); $wrapper->string('subtitle', array('label' => __('Subtitle', 'podlove'), 'description' => __('Extension to the title. Clarify what the podcast is about.', 'podlove'), 'html' => array('class' => 'regular-text podlove-check-input'))); $wrapper->text('summary', array('label' => __('Summary', 'podlove'), 'description' => __('Elaborate description of the podcast\'s content.', 'podlove'), 'html' => array('rows' => 3, 'cols' => 40, 'class' => 'autogrow podlove-check-input'))); $wrapper->upload('cover_image', array('label' => __('Cover Art URL', 'podlove'), 'description' => __('JPEG or PNG. At least 1400 x 1400 pixels.', 'podlove'), 'html' => array('class' => 'regular-text podlove-check-input', 'data-podlove-input-type' => 'url'), 'media_button_text' => __("Use for Podcast Cover Art", 'podlove'))); $wrapper->select('language', array('label' => __('Language', 'podlove'), 'description' => __('', 'podlove'), 'default' => get_bloginfo('language'), 'options' => \Podlove\Locale\locales())); }); }
private function form_template($season, $action, $button_text = NULL) { wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-datepicker'); $form_args = array('context' => 'podlove_season', 'hidden' => array('season' => $season->id, 'action' => $action), 'submit_button' => false, 'form_end' => function () { echo "<p>"; submit_button(__('Save Changes'), 'primary', 'submit', false); echo " "; submit_button(__('Save Changes and Continue Editing', 'podlove'), 'secondary', 'submit_and_stay', false); echo "</p>"; }); \Podlove\Form\build_for($season, $form_args, function ($form) { $wrapper = new \Podlove\Form\Input\TableWrapper($form); $season = $form->object; $wrapper->string('title', ['label' => __('Title', 'podlove') . \Podlove\get_help_link('podlove_help_seasons_title'), 'html' => ['class' => 'regular-text podlove-check-input']]); $wrapper->string('subtitle', ['label' => __('Subtitle', 'podlove'), 'html' => ['class' => 'regular-text podlove-check-input']]); $wrapper->text('summary', ['label' => __('Summary', 'podlove'), 'html' => array('rows' => 3, 'cols' => 40, 'class' => 'autogrow podlove-check-input')]); $wrapper->string('start_date', ['label' => __('Start Date', 'podlove') . \Podlove\get_help_link('podlove_help_seasons_date'), 'html' => ['class' => 'regular-text podlove-check-input', 'readonly' => 'readonly']]); $wrapper->upload('image', ['label' => __('Image', 'podlove'), 'html' => ['class' => 'regular-text podlove-check-input', 'data-podlove-input-type' => 'url'], 'media_button_text' => __("Use Image for Season", 'podlove')]); }); }