columns->clear(); $this->columns->add('stats', __('U / I / %', 'bizpanda')); $this->columns->add('title', __('Locker Title', 'bizpanda')); if ( !BizPanda::isSinglePlugin() ) { $this->columns->add('type', __('Type', 'bizpanda')); } $this->columns->add('shortcode', __('Shortcode', 'bizpanda')); $this->columns->add('theme', __('Theme', 'bizpanda')); $this->columns->add('bulk', __('Bulk Lock', 'bizpanda')); $this->columns->add('visibility', __('Visibility Conditions', 'bizpanda')); /** * Scripts & styles */ $this->scripts->add(OPANDA_BIZPANDA_URL . '/assets/admin/js/item-view.010000.js'); $this->styles->add(OPANDA_BIZPANDA_URL . '/assets//admin/css/item-view.010000.css'); } /** * Column 'Title' */ public function columnTitle( $post, $isFullMode ) { if ($isFullMode ) { $url = get_post_meta($post->ID, 'opanda_theme', true); if ( empty($url) ) $url = '[current page]'; echo '

' . $post->post_title . '

'; echo '

' . $url . '

'; } else { echo $post->post_title; } } /** * Column 'Type' */ public function columnType( $post, $isFullMode ) { $item = get_post_meta($post->ID, 'opanda_item', true); echo $item; } /** * Column 'Shortcode' */ public function columnShortcode( $post, $isFullMode ) { $isSystem = get_post_meta( $post->ID, 'opanda_is_system', true); $itemTypeName = get_post_meta( $post->ID, 'opanda_item', true); $item = OPanda_Items::getItem( $itemTypeName ); $shortcodeName = $item['shortcode']; $shortcode = '[' . $shortcodeName . '] [/' . $shortcodeName . ']'; if (!$isSystem) $shortcode = '[' . $shortcodeName . ' id="' . $post->ID . '"] [/' . $shortcodeName . ']'; ?>
ID ); ?>
ID, 'opanda_style', true); echo $theme; } /** * Column 'Visibility Conditions' */ public function columnVisibility( $post, $isFullMode ) { $mode = get_post_meta($post->ID, 'opanda_visibility_mode', true); if ( empty( $mode) ) $mode = 'simple'; ?>
ID ); ?> ID ); ?>
ID, 'opanda_imperessions', true) ); $conversion = '0'; $unlocks = intval( get_post_meta($post->ID, 'opanda_unlocks', true) ); if ( !empty( $imperessions )) { $conversion = round( $unlocks / $imperessions * 100, 2 ); } elseif ( !empty( $unlocks ) ) { $conversion = 100; } $strong = ( $unlocks > 0 ); $url = opanda_get_admin_url('stats', array('opanda_id' => $post->ID)); if ( $strong ) { echo '' . $unlocks . ' / ' . $imperessions . ' / ' . sprintf( '%.02f', $conversion ) . '%' . ''; } else { echo '' . $unlocks . ' / ' . $imperessions . ' / ' . sprintf( '%.02f', $conversion ) . '%' . ''; } ?> post_type !== $this->type->name ) return $actions; $temporaryActions = array( 'edit' => $actions['edit'], 'clone' => '' . __("Clone", 'bizpanda') . '', 'trash' => $actions['trash'] ); return parent::actionPostRowActions( $temporaryActions ); } }