PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /proc/thread-self/root/proc/self/root/var/softaculous/sitepad/editor/site-admin/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : //proc/thread-self/root/proc/self/root/var/softaculous/sitepad/editor/site-admin/edit.php |
<?php /** * Edit Posts Administration Screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! $typenow ) { wp_die( __( 'Invalid post type.' ) ); } if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) { wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) ); } if ( 'attachment' === $typenow ) { if ( wp_redirect( admin_url( 'upload.php' ) ) ) { exit; } } /** * @global string $post_type * @global WP_Post_Type $post_type_object */ global $post_type, $post_type_object; $post_type = $typenow; $post_type_object = get_post_type_object( $post_type ); if ( ! $post_type_object ) { wp_die( __( 'Invalid post type.' ) ); } if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>', 403 ); } $wp_list_table = _get_list_table( 'WP_Posts_List_Table' ); $pagenum = $wp_list_table->get_pagenum(); // Back-compat for viewing comments of an entry foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) { if ( ! empty( $_REQUEST[ $_redirect ] ) ) { wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) ); exit; } } unset( $_redirect ); $err = optGET('error_type'); if(!empty($err)){ $err_type = 'pages'; $more_txt = 'pages'; $type_txt = 'Page(s)'; $plan = empty($sitepad['license']['plan']) ? 'Free' : $sitepad['license']['plan']; $sitepad_error = '<div id="message" class="error" style="margin-top:20px;"><center><p>You have reached maximum limit of <b>'.$sitepad['features'][$err_type].'</b> '.$type_txt.' allowed in <b>'.$plan.'</b> Plan. <a href="'.admin_url('plans.php').'">Click here to upgrade your plan</a> and add more '.$more_txt.'.</p></center></div>'; } if ( 'post' != $post_type ) { $parent_file = "edit.php?post_type=$post_type"; $submenu_file = "edit.php?post_type=$post_type"; $post_new_file = "post-new.php?post_type=$post_type"; } else { $parent_file = 'edit.php'; $submenu_file = 'edit.php'; $post_new_file = 'post-new.php'; } $doaction = $wp_list_table->current_action(); if ( $doaction ) { check_admin_referer( 'bulk-posts' ); $sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'locked', 'ids' ), wp_get_referer() ); if ( ! $sendback ) { $sendback = admin_url( $parent_file ); } $sendback = add_query_arg( 'paged', $pagenum, $sendback ); if ( strpos( $sendback, 'post.php' ) !== false ) { $sendback = admin_url( $post_new_file ); } if ( 'delete_all' == $doaction ) { // Prepare for deletion of all posts with a specified post status (i.e. Empty trash). $post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] ); // Validate the post status exists. if ( get_post_status_object( $post_status ) ) { $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) ); } $doaction = 'delete'; } elseif ( isset( $_REQUEST['media'] ) ) { $post_ids = $_REQUEST['media']; } elseif ( isset( $_REQUEST['ids'] ) ) { $post_ids = explode( ',', $_REQUEST['ids'] ); } elseif ( ! empty( $_REQUEST['post'] ) ) { $post_ids = array_map( 'intval', $_REQUEST['post'] ); } if ( ! isset( $post_ids ) ) { wp_redirect( $sendback ); exit; } switch ( $doaction ) { case 'trash': $trashed = $locked = 0; foreach ( (array) $post_ids as $post_id ) { if ( ! current_user_can( 'delete_post', $post_id ) ) { wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) ); } if ( wp_check_post_lock( $post_id ) ) { $locked++; continue; } if ( ! wp_trash_post( $post_id ) ) { wp_die( __( 'Error in moving to Trash.' ) ); } $trashed++; } $sendback = add_query_arg( array( 'trashed' => $trashed, 'ids' => join( ',', $post_ids ), 'locked' => $locked, ), $sendback ); break; case 'untrash': $untrashed = 0; foreach ( (array) $post_ids as $post_id ) { if ( ! current_user_can( 'delete_post', $post_id ) ) { wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) ); } if ( ! wp_untrash_post( $post_id ) ) { wp_die( __( 'Error in restoring from Trash.' ) ); } $untrashed++; } $sendback = add_query_arg( 'untrashed', $untrashed, $sendback ); break; case 'delete': $deleted = 0; foreach ( (array) $post_ids as $post_id ) { $post_del = get_post( $post_id ); if ( ! current_user_can( 'delete_post', $post_id ) ) { wp_die( __( 'Sorry, you are not allowed to delete this item.' ) ); } if ( $post_del->post_type == 'attachment' ) { if ( ! wp_delete_attachment( $post_id ) ) { wp_die( __( 'Error in deleting.' ) ); } } else { if ( ! wp_delete_post( $post_id ) ) { wp_die( __( 'Error in deleting.' ) ); } } $deleted++; } $sendback = add_query_arg( 'deleted', $deleted, $sendback ); break; case 'edit': if ( isset( $_REQUEST['bulk_edit'] ) ) { $done = bulk_edit_posts( $_REQUEST ); if ( is_array( $done ) ) { $done['updated'] = count( $done['updated'] ); $done['skipped'] = count( $done['skipped'] ); $done['locked'] = count( $done['locked'] ); $sendback = add_query_arg( $done, $sendback ); } } break; default: /** This action is documented in site-admin/edit-comments.php */ $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $post_ids ); break; } $sendback = remove_query_arg( array( 'action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view' ), $sendback ); wp_redirect( $sendback ); exit(); } elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) { wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); exit; } $wp_list_table->prepare_items(); wp_enqueue_script( 'inline-edit-post' ); wp_enqueue_script( 'heartbeat' ); if ( 'wp_block' === $post_type ) { wp_enqueue_script( 'wp-list-reusable-blocks' ); wp_enqueue_style( 'wp-list-reusable-blocks' ); } $title = $post_type_object->labels->name; if ( 'post' == $post_type ) { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'screen-content', 'title' => __( 'Screen Content' ), 'content' => '<p>' . __( 'You can customize the display of this screen’s contents in a number of ways:' ) . '</p>' . '<ul>' . '<li>' . __( 'You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.' ) . '</li>' . '<li>' . __( 'You can filter the list of posts by post status using the text links above the posts list to only show posts with that status. The default view is to show all posts.' ) . '</li>' . '<li>' . __( 'You can view posts in a simple title list or with an excerpt using the Screen Options tab.' ) . '</li>' . '<li>' . __( 'You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.' ) . '</li>' . '</ul>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'action-links', 'title' => __( 'Available Actions' ), 'content' => '<p>' . __( 'Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:' ) . '</p>' . '<ul>' . '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.' ) . '</li>' . '<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.' ) . '</li>' . '<li>' . __( '<strong>Trash</strong> removes your post from this list and places it in the trash, from which you can permanently delete it.' ) . '</li>' . '<li>' . __( '<strong>Preview</strong> will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post’s status.' ) . '</li>' . '</ul>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'bulk-actions', 'title' => __( 'Bulk Actions' ), 'content' => '<p>' . __( 'You can also edit or move multiple posts to the trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.' ) . '</p>' . '<p>' . __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://sitepad.com/docs/Posts_Screen">Documentation on Managing Posts</a>' ) . '</p>' . '<p>' . __( '<a href="https://sitepad.com/support/">Support Forums</a>' ) . '</p>' ); } elseif ( 'page' == $post_type ) { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'managing-pages', 'title' => __( 'Managing Pages' ), 'content' => '<p>' . __( 'Managing pages is very similar to managing posts, and the screens can be customized in the same way.' ) . '</p>' . '<p>' . __( 'You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple pages at once.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://sitepad.com/docs/Pages_Screen">Documentation on Managing Pages</a>' ) . '</p>' . '<p>' . __( '<a href="https://sitepad.com/support/">Support Forums</a>' ) . '</p>' ); } get_current_screen()->set_screen_reader_content( array( 'heading_views' => $post_type_object->labels->filter_items_list, 'heading_pagination' => $post_type_object->labels->items_list_navigation, 'heading_list' => $post_type_object->labels->items_list, ) ); add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page', ) ); $bulk_counts = array( 'updated' => isset( $_REQUEST['updated'] ) ? absint( $_REQUEST['updated'] ) : 0, 'locked' => isset( $_REQUEST['locked'] ) ? absint( $_REQUEST['locked'] ) : 0, 'deleted' => isset( $_REQUEST['deleted'] ) ? absint( $_REQUEST['deleted'] ) : 0, 'trashed' => isset( $_REQUEST['trashed'] ) ? absint( $_REQUEST['trashed'] ) : 0, 'untrashed' => isset( $_REQUEST['untrashed'] ) ? absint( $_REQUEST['untrashed'] ) : 0, ); $bulk_messages = array(); $bulk_messages['post'] = array( 'updated' => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ), 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) : _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ), 'deleted' => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ), 'trashed' => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ), 'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ), ); $bulk_messages['page'] = array( 'updated' => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ), 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) : _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ), 'deleted' => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ), 'trashed' => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ), 'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ), ); $bulk_messages['wp_block'] = array( 'updated' => _n( '%s block updated.', '%s blocks updated.', $bulk_counts['updated'] ), 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 block not updated, somebody is editing it.' ) : _n( '%s block not updated, somebody is editing it.', '%s blocks not updated, somebody is editing them.', $bulk_counts['locked'] ), 'deleted' => _n( '%s block permanently deleted.', '%s blocks permanently deleted.', $bulk_counts['deleted'] ), 'trashed' => _n( '%s block moved to the Trash.', '%s blocks moved to the Trash.', $bulk_counts['trashed'] ), 'untrashed' => _n( '%s block restored from the Trash.', '%s blocks restored from the Trash.', $bulk_counts['untrashed'] ), ); /** * Filters the bulk action updated messages. * * By default, custom post types use the messages for the 'post' post type. * * @since 3.7.0 * * @param array[] $bulk_messages Arrays of messages, each keyed by the corresponding post type. Messages are * keyed with 'updated', 'locked', 'deleted', 'trashed', and 'untrashed'. * @param int[] $bulk_counts Array of item counts for each message, used to build internationalized strings. */ $bulk_messages = apply_filters( 'bulk_post_updated_messages', $bulk_messages, $bulk_counts ); $bulk_counts = array_filter( $bulk_counts ); require_once( ABSPATH . 'site-admin/admin-header.php' ); ?> <div class="wrap"> <div class="row mb-3 align-items-center"> <div class="col-6 col-sm-6"> <h1 class="wp-heading-inline"> <?php echo esc_html( $post_type_object->labels->name ); ?> </h1> </div> <div class="col-6 col-sm-6 text-right"> <?php if ( current_user_can( $post_type_object->cap->create_posts ) ) { echo '<a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>'; } ?> </div> </div> <?php if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { /* translators: %s: search keywords */ printf( ' <span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', get_search_query() ); } ?> <hr class="wp-header-end"> <?php // If we have a bulk message to issue: $messages = array(); foreach ( $bulk_counts as $message => $count ) { if ( isset( $bulk_messages[ $post_type ][ $message ] ) ) { $messages[] = sprintf( $bulk_messages[ $post_type ][ $message ], number_format_i18n( $count ) ); } elseif ( isset( $bulk_messages['post'][ $message ] ) ) { $messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) ); } if ( $message == 'trashed' && isset( $_REQUEST['ids'] ) ) { $ids = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] ); $messages[] = '<a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", 'bulk-posts' ) ) . '">' . __( 'Undo' ) . '</a>'; } } if ( $messages ) { echo '<div id="message" class="updated notice is-dismissible"><p>' . join( ' ', $messages ) . '</p></div>'; } unset( $messages ); if(!empty($sitepad_error)){ echo $sitepad_error; } unset( $sitepad_error ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed' ), $_SERVER['REQUEST_URI'] ); ?> <form id="posts-filter" method="get"> <?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?> <input type="hidden" name="post_status" class="post_status_page" value="<?php echo ! empty( $_REQUEST['post_status'] ) ? esc_attr( $_REQUEST['post_status'] ) : 'all'; ?>" /> <input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" /> <?php if ( ! empty( $_REQUEST['author'] ) ) { ?> <input type="hidden" name="author" value="<?php echo esc_attr( $_REQUEST['author'] ); ?>" /> <?php } ?> <?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?> <input type="hidden" name="show_sticky" value="1" /> <?php } ?> <?php // For posts and other if($post_type != 'page'){ $wp_list_table->display(); }else{ $wp_list_table->display_tablenav( 'top' ); echo '<div class="container"><div class="row">'; // Shows the page tile function page_tile($v){ global $sitepad; $v = get_post($v->ID); $actions = []; $screenshot = sitepad_assets_url().'/images/no_screenshot.png'; // Do we have a screenshot if(file_exists($sitepad['screenshots_path'].'/'.$v->post_name.'.jpg')){ $screenshot = $sitepad['upload_url'].sitepad_screenshot_relative($v->post_name); } //echo $v->post_title.' - '.$v->post_type.' - '.$v->ID; if ( 'trash' != $v->post_status ){ $actions['view'] = '<a href="' . (!empty($_SERVER['HTTPS']) ? str_replace('http://', 'https://' , get_permalink( $v->ID )) : get_permalink( $v->ID ) ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $v->post_title ) ) . '" rel="permalink" class="row_act_view">' . '</a>'; $actions['edit'] = '<a href="'. pagelayer_livelink( $v->ID ) .'" title="' . esc_attr__( 'Edit this item' ) . '" class="row_act_edit"></a>'; if($v->post_type == 'page'){ $actions['clone'] = '<a href="' . sitepad_clone_post_link( $v->ID ) . '" title="'. esc_attr__( 'Clone this Page' ) . '" class="row_act_clone"></a>'; } } if ( 'trash' === $v->post_status ){ $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash' ) . "' href='" . admin_url( 'post.php?post='.$v->ID.'&action=untrash&_wpnonce='.wp_create_nonce('untrash-post_' . $v->ID) ). "' class='row_act_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( $v->ID ) . "'>" ."</a>"; // .__( 'Trash' ) . } if ( 'trash' === $v->post_status || !EMPTY_TRASH_DAYS ) { $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $v->ID, '', true ) . "'>" . "</a>"; } echo ' <div class="col-sm-4 page-tile" onclick="page_tile_choose(event)"> <div class="page-screenshot"> <div class="page-screenshot-overlay"> <div class="row_act_icons align-middle text-center">'.implode(' ', $actions).'</div> </div> <img src="'.$screenshot.'" width="100%" /> </div> <div class="page-desc row m-0"> <div class="col-sm-10"> <input type="checkbox" id="cb-select-'.$v->ID.'" name="post[]" value="'.$v->ID.'" /> <span class="align-middle page-tile-title">'.$v->post_title.'</span> <div class="post-name-div"> ' . __( 'Slug' ) . ': '.$v->post_name; _post_states($v); echo ' </div> </div> <div class="col-sm-2 px-0"> <div class="row_act_icons page-edit">'. $actions['edit'] .'</div> </div> </div> </div>'; } // Header Footer tile function hf_tile($v){ $actions = []; //echo $v->post_title.' - '.$v->post_type.' - '.$v->ID; $actions['edit'] = '<a href="'. pagelayer_livelink( $v->ID ) .'" title="' . esc_attr__( 'Edit this item' ) . '" class="hf-edit">' . __( 'Edit' ) . '</a>'; echo ' <div class="col-sm-6 hf-tile" onclick="hf_edit(this)"> <div class="hf-desc"> <div class="row"> <span class="col-sm-8 align-middle hf-tile-title">'.$v->post_title.'</span> <span class="text-right align-middle col-sm-4">'.implode(' ', $actions).'</span> </div> </div> </div>'; } // Show the header and footer as well if($post_type == 'page' && empty($post_status)){ $pl_query = new WP_Query(['post_type' => ['pagelayer-template'], 'orderby' => 'post_name', 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => 'pagelayer_template_type', 'value' => array( 'header', 'footer' ), 'compare' => 'IN', ), ), ]); //r_print($pl_query->posts); foreach($pl_query->posts as $k => $v){ $meta = get_post_meta($k, 'pagelayer_template_type'); hf_tile($v); } echo '</div><div class="row">'; } foreach($wp_query->posts as $k => $v){ page_tile($v); } echo '</div></div> <script> function hf_edit(ele){ window.location = jQuery(ele).find(".hf-edit").attr("href"); } function page_tile_choose(e){ var tEle = jQuery(e.target); var jEle = tEle.parents(".page-tile"); if(jEle.find("input")[0] != tEle[0]){ jEle.find("input").trigger("click"); } } </script>'; } ?> </form> <?php if ( $wp_list_table->has_items() ) { $wp_list_table->inline_edit(); } ?> <div id="ajax-response"></div> <br class="clear" /> </div> <?php include( ABSPATH . 'site-admin/admin-footer.php' );