user = wp_get_current_user(); $this->user_id = $this->user->ID; $this->config = JVB_CONTENT[$content]; $this->singular = $this->config['singular']; $this->plural = $this->config['plural']; $this->content = $content; $this->fields = jvbGetFields($this->content, 'post'); $this->sections = jvbGetSections($this->content, 'post'); $this->stuck = [ 'post_title', 'term_name' ]; $this->init(); } protected function init():void { $this->initStatuses(); $this->initBulkActions(); $this->initTaxonomies(); $this->initFilters(); $this->meta = new MetaManager(null, 'post', $this->content); $plural = strtolower($this->config['plural']??$this->content.'s'); $this->userCanPublish = (jvbUserIsVerified()) ? user_can($this->user_id, "publish_{$plural}") : false; } protected function initTaxonomies():void { $this->taxonomies = array_filter(JVB_TAXONOMY, function ($config) { return in_array($this->content, $config['for_content']); }); } protected function initStatuses():void { $this->statuses = (array_key_exists('is_calendar', $this->config)) ? [ 'all' => [ 'icon' => 'calendar', 'label' => 'Everything', ], 'future'=> [ 'label' => 'Upcoming', 'icon' => 'future', ], 'past' => [ 'label' => 'Past', 'icon' => 'past', ], 'repeat'=> [ 'label' => 'Recurring', 'icon' => 'repeat', ], 'draft' => [ 'icon' => 'hide', 'label' => 'Hidden', ], 'trash' => [ 'label' => 'Scrapped', 'icon' => 'delete', ], ] : [ 'all' => [ 'icon' => 'all', 'label' => 'Everything', ], 'publish'=> [ 'icon' => 'publish', 'label' => 'Live', ], 'draft' => [ 'icon' => 'hide', 'label' => 'Hidden', ], 'trash' => [ 'label' => 'Scrapped', 'icon' => 'delete', ], ]; } protected function initBulkActions():void { $this->bulkActions = [ 'edit' => 'Edit', 'publish' => 'Show', 'draft' => 'Hide', // 'copy' => 'Duplicate', 'trash' => 'Scrap' ]; } protected function initFilters():void { $this->filters = [ 'status' => $this->statuses, 'date' => [ 'label' => 'Date', 'icon' => 'calendar' ] ]; foreach ($this->taxonomies as $taxonomy=> $config) { $this->filters['taxonomy'][$taxonomy] = [ 'label' => $config['singular'], 'icon' => $taxonomy ]; } } public function render():void { ob_start(); ?>
renderHeader(); $this->renderContent(); $this->renderModals(); $this->renderTemplates(); ?>

Your config['plural'] ?>

config)) { ?>

config['page_description']?>

renderHeaderActions(); } protected function renderHeaderActions():void { $uploadConfig = [ 'type' => 'upload', 'subtype' => 'image', 'mode' => (jvbCheck('single_image', $this->config)) ? 'direct' : 'selection', 'create_new' => true, 'label' => (array_key_exists('image_title', $this->config)) ? $this->config['image_title'] : 'Upload More '.$this->config['plural'], 'content' => $this->content, 'singular' => $this->singular, 'plural' => $this->plural, 'multiple' => true, 'destination' => 'post' ]; if (!jvbCheck('single_image', $this->config)) { $uploadConfig['destination'] = 'post_group'; } $uploadConfig['destination'] = 'post_group'; if (!jvbCheck('single_image', $this->config)) { $uploadConfig['group_title'] = 'Create '.$this->config['plural']; $uploadConfig['group_description'] = '

Drag images into groups. Each group becomes its own '.$this->singular.'.

You can also select multiple images and click the "Add to Group" button.

If a '.$this->singular.' has multiple images, you can select the '.jvbIcon('star').' to set an image as the main one.

Images left ungrouped will become individual '.$this->plural.'

Once finished, click the \'Save Changes\' button to send to server for processing.

'; } else { $uploadConfig['description'] = 'Each image will become its own '.$this->singular.'.'; } ?>
config['upload_title'] ?? 'Bulk Upload '.$this->plural?> meta->render( 'form', 'new_'.$this->content, $uploadConfig ); ?>
renderFilters(); $this->renderBulkControls(); ?>
renderEmptyState(), $this->content); echo ''; ?>

content)?>Nothing herecontent)?>

It doesn't look like you have any config['plural'] ?> yet.

Add many by uploading images above., or click the "" button to add one at a time.

renderViewFilters(); $this->renderStatusFilters(); $this->renderOrderFilters(); ?>
Filters: renderTaxonomyFilters(); $this->renderDateFilters(); ?>
renderColumnSelector(); ?>
[ 'date' => 'Order by date created', 'alphabetical' => 'Order alphabetically' ], 'order' => [ 'asc' => 'In ascending order (Z-A, oldest to newest)', 'desc' => 'In descending order (A-Z, newest to oldest)' ] ]; foreach ($order as $o => $option) { ?>
: $label) { ?> >
statuses)) { return; } ?>
Status: statuses as $status => $config) { $checked = ($i == 1) ? ' checked' : ''; ?> >
View: ['icon' => 'grid', 'label' => 'Grid View'], 'list' => ['icon' => 'list', 'label' => 'List View'], 'table' => ['icon' => 'table', 'label' => 'Table View'] ]; $first = true; foreach ($views as $view => $config): ?> >
taxonomies)) { return; } $out = ''; foreach ($this->taxonomies as $taxonomy => $config) { $terms = $this->getCommonTerms($taxonomy); if (!empty($terms)) { $out .= sprintf( '
'; } } echo $out; } /** * Get common terms for taxonomy * @param string $taxonomy * @return array */ protected function getCommonTerms(string $taxonomy):array { $manager = new UserTermsManager(); return $manager->getUserTerms($this->user_id, $taxonomy); } protected function renderDateFilters():void { $postType = jvbCheckBase($this->content); // Get available months global $wpdb; $months = $wpdb->get_results(" SELECT DISTINCT YEAR(post_date) as year, MONTH(post_date) as month FROM $wpdb->posts WHERE post_type = '{$postType}' AND post_author = '{$this->user_id}' ORDER BY post_date DESC "); // Quick filters $out = '
'; $form = '
'; // Custom date range $out .= jvbNewModal( 'date-range', 'Filter Results by Date:', $form ); echo $out; } protected function renderBulkControls():void { if (empty($this->bulkActions)) { return; } ?>
renderCreateModal(); $this->renderEditModal(); $this->renderBulkEditModal(); } protected function renderCreateModal():void { echo jvbNewModal( 'create', 'Creating New '.$this->config['singular'], str_replace('edit-form"', 'create-form" data-noautosave', $this->editForm()) ); } protected function editForm():string { ob_start(); ?>
Status: getApplicableStatuses('edit'); ?>
userCanPublish) { ?>

Your account needs to be verified before you can publish content.

sections)) { $tabs = []; foreach ($this->sections as $slug => $title) { $tabs[$slug] = [ 'title' => $title, 'content' => '', 'description' => jvbSectionDescription($slug)??'', ]; $icon = jvbSectionIcon($slug); if ($icon !== '') { $tabs[$slug]['icon'] = $icon; } } } else { $tabs = false; } $fields = $this->fields; $first = ['post_thumbnail', 'post_title', 'price']; foreach ($first as $f) { if (array_key_exists($f, $fields)) { if ($tabs) { $tabs['basic']['content'] .= $this->meta->render('form', $f, $fields[$f], false, true); } else { $this->meta->render('form', $f, $fields[$f]); } unset($fields[$f]); } } foreach ($fields as $n => $config) { if ($tabs) { $section = (array_key_exists('section', $config)) ? $config['section'] : 'basic'; $tabs[$section]['content'] .= $this->meta->render('form', $n, $config, false, true); } else { $this->meta->render('form', $n, $config); } } if ($tabs) { jvbRenderTabs($tabs); } ?>
statuses as $status => $config) { if ($status === 'all') { continue; } if (in_array($status, ['future', 'past'])) { if ($status === 'future') { $status = 'publish'; $config = [ 'icon' => 'publish', 'label' => 'Live', ]; } else { continue; } } $disabled = ($status === 'publish' && !$this->userCanPublish) ? ' disabled' : ''; ?> > singular, $this->editForm() ); } protected function renderBulkEditModal():void { if (empty($this->bulkActions)) return; ob_start(); ?>

You can unselect items by clicking the image here.

IMPORTANT: Whatever changes you make here will be applied to all selected plural?>.

getApplicableStatuses('bulk-'); ?>
taxonomies)) { ?>
taxonomies as $taxonomy => $config) { $this->meta->render( 'form', 'bulk-edit-'.$taxonomy, [ 'type' => 'taxonomy', 'label' => $config['singular'], 'taxonomy' => $taxonomy, 'createNew' => jvbUserIsVerified(), 'multiple' => true, 'mode' => 'append' ] ); } ?>
fields; $fields = array_filter($fields, function ($field) { return array_key_exists('bulkEdit', $field); }); foreach ($fields as $fieldName => $config) { $this->meta->render('form', $fieldName, $config); } ?>
'.$this->config['plural'], $form ); } protected function renderTemplates():void { $this->renderListView(); $this->renderGridView(); $this->renderTableView(); $this->renderTableRow(); echo jvbGetEmptyStateTemplate(); echo jvbGetGalleryPreviewTemplate(); } protected function renderItemSelect():string { ob_start(); ?>
singular ?>
fields as $name => $config) { $renderMode = $form ? 'form' : 'render'; $field = $this->meta->render($renderMode, $name, $config, false, true); // Special handling for title in grid view if ($name === 'post_title' && !$form) { $field = str_replace('', '', $field)); } echo $field; } return ob_get_clean(); } protected function renderGridView():void { ?>
statuses as $status => $config): if ($status === 'all') continue; // Handle special cases if ($status === 'future') { $status = 'publish'; $config = [ 'icon' => 'publish', 'label' => 'Live' ]; } elseif ($status === 'past') { continue; } ?>
Status fields as $name => $config): if (array_key_exists('hidden', $config)){ continue; } ?> stuck)) ? ' data-stuck':''?>>