Changeset 2015672
- Timestamp:
- 01/20/2019 09:13:07 AM (7 years ago)
- Location:
- orders-table
- Files:
-
- 4 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
trunk/Readme.txt (modified) (2 diffs)
-
trunk/orders-table.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
orders-table/trunk/Readme.txt
r1477216 r2015672 1 1 === Orders Table === 2 2 Contributors: Somonator 3 Tags: post, edit, order3 Tags: order, post 4 4 Requires at least: 3.0 5 Tested up to: 4. 65 Tested up to: 4.9.9 6 6 Stable tag: 1.0 7 7 … … 12 12 13 13 == Installation == 14 1) Install this plugin. 15 16 2) Add shortcode in tour page ([orders-table]) 17 18 3) Well done! 14 1. Install this plugin. 15 2. Add shortcode in tour page ([orders-table]) 16 3. Configure the plugin and fields as you need 17 3. Well done! 19 18 20 19 == Frequently Asked Questions == 21 ● If you knock out dictionary pages 404, then go to settings - constant references and click save, without setting changes. 20 ● The plugin has shortcode [orders-table], add it to your page. 21 ● You give users access to the form or add them yourself. 22 ● Required fields can be customized 23 ● You can inform users about the implementation of the order using the function "order status". The status will be displayed in the table as icons, and you can change the status when editing in the admin panel. 24 ● You can translate this plugin into your language by using any editor. (If you did, please email me throw off the transfer, which would facilitate my work). 22 25 23 ● The plugin has shortcode [orders-table], add it to your page .24 25 ● You can translate this plugin into your language by using any editor. (If you did, please email me throw off the transfer, which would facilitate my work).26 26 == Screenshots == 27 1. Admin of orders table 28 2. Archive of orders table 27 1. Orders 28 1. Options plugin 29 2. View orders table 29 30 30 31 == Changelog == 31 32 1.0 Release 33 1.1 Completely rewritten code, add options page, add configure access for form table for guest, add extra fields, add manage main and extra fileds. -
orders-table/trunk/orders-table.php
r1742611 r2015672 1 1 <?php 2 2 /* 3 Plugin Name: Orders Table4 Plugin URI: none 5 Description: Plugin to create a order table 6 Version: 1.0 7 Author: Somonator8 Author URI: none 3 Plugin Name: Orders Table 4 Plugin URI: 5 Description: The plugin allows you to make a convenient order page for your site. It is perfect for a store, hotel or a simple master of billets. Adjust it as it should and achieve the desired result. 6 Version: 1.1 7 Author: Somonator 8 Author URI: 9 9 */ 10 10 11 /* Copyright 2016 Alexsandr (email: somonator@gmail.com) 11 /* 12 Copyright 2016 Alexsandr (email: somonator@gmail.com) 12 13 13 14 This program is free software; you can redistribute it and/or modify … … 26 27 */ 27 28 28 if ( ! defined( 'ABSPATH' )) exit;29 if (!defined('ABSPATH')) exit; 29 30 30 add_action( 'init', 'order_table_order_new_post_type_register' ); 31 function order_table_order_new_post_type_register() { 32 $labels = array( 33 'name' => __('Orders Table', 'orders-table'), 34 'singular_name' => __('Description order', 'orders-table'), 35 'add_new' => __('Add order', 'orders-table'), 36 'add_new_item' => __('Add new order', 'orders-table'), 37 'edit_item' => __('Edit order', 'orders-table'), 38 'new_item' => __('New order', 'orders-table'), 39 'all_items' => __('All orders', 'orders-table'), 40 'not_found' => __('Orders not found.', 'orders-table'), 41 'not_found_in_trash' => __('The basket does not have the orders.', 'orders-table'), 42 'menu_name' => __('Orders Table', 'orders-table') 43 ); 44 $args = array( 45 'labels' => $labels, 46 'public' => false, 47 'show_ui' => true, 48 'menu_icon' => 'dashicons-list-view', 49 'menu_position' => 3, 50 'supports' => array( 'title', 'editor', 'author') 51 ); 52 register_post_type('orders-table', $args); 53 register_taxonomy( 'orders-category', 'orders-table', 54 array( 'hierarchical' => true, 55 'label' => __('Category', 'orders-table') 56 ) 57 ); 58 } 59 add_filter( 'post_updated_messages', 'post_messages_order_table' ); 60 function post_messages_order_table( $messages ) { 61 global $post, $post_ID; 62 $messages['orders-table'] = array( 63 0 => '', 64 1 => sprintf( __('Order updated.', 'orders-table')), 65 2 => __('The parameter is updated.', 'orders-table'), 66 3 => __('The parameter is remove.', 'orders-table'), 67 4 => __('Order is updated', 'orders-table'), 68 5 => isset($_GET['revision']) ? sprintf( __('Order restored from the editorial: %s', 'orders-table'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 69 6 => sprintf( __('Order published on the website.', 'orders-table')), 70 7 => __('Order saved.', 'orders-table'), 71 8 => sprintf( __('Order submitted for review.', 'orders-table')), 72 9 => sprintf( __('Scheduled for publication: <strong>%1$s</strong>.', 'orders-table'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ), 73 10 => sprintf( __('Draft updated order.', 'orders-table')), 74 ); 75 76 return $messages; 77 } 31 require_once('inc/functions.php'); 78 32 79 function order_table_new_post_status_awaiting_verification (){ 80 $numberpostav = '<span class="count">(%s)</span>'; 81 register_post_status( 'awaitingverification', array( 82 'label' => __('Awaiting verification', 'orders-table'), 83 'label_count' => _n_noop( __('Awaiting verification', 'orders-table').$numberpostav, __('Awaiting verification', 'orders-table').$numberpostav), 84 'public' => true, 85 'show_in_admin_status_list' => true 86 ) ); 87 88 } 89 add_action( 'init', 'order_table_new_post_status_awaiting_verification' ); 33 /** 34 * Add new post type. 35 */ 36 new ot_post_type(); 90 37 91 function order_table_new_post_status_awaiting_verification_list(){ 92 global $post; 93 $optionselected = ''; 94 $statusname = ''; 95 if( $post->post_type == 'orders-table' ){ 96 if($post->post_status == 'awaitingverification'){ 97 $optionselected = ' selected="selected"'; 98 $statusname = "$('#post-status-display').text('__('Awaiting verification', 'orders-table')');"; 99 } 100 echo "<script> 101 jQuery(function($){ 102 $('select#post_status').append('<option value=\"awaitingverification\"$optionselected>__('Awaiting verification', 'orders-table')</option>'); 103 $statusname 104 }); 105 </script>"; 106 } 107 } 108 add_action('admin_footer-post-new.php', 'order_table_new_post_status_awaiting_verification_list'); 109 add_action('admin_footer-post.php', 'order_table_new_post_status_awaiting_verification_list'); 38 /** 39 * New post status for post type. 40 */ 41 new ot_new_post_status(); 110 42 111 function order_table_new_post_status_awaiting_verification_display( $statuses ) { 112 global $post; 113 if( $post->post_type == 'orders-table' ){ 114 if( get_query_var( 'post_status' ) != 'awaitingverification' ){ 115 if($post->post_status == 'awaitingverification'){ 116 return array(__('Awaiting verification', 'orders-table')); 117 } 118 } 119 } 120 return $statuses; 121 } 122 123 add_filter( 'display_post_states', 'order_table_new_post_status_awaiting_verification_display' ); 43 /** 44 * Create options page for pligin. 45 */ 46 new ot_option_page(); 124 47 125 function add_styls_orders_table_wp() { 126 wp_enqueue_style( 'style-orders-table', plugin_dir_url(__FILE__ ). 'css/style-orders-table.css' ); 127 } 128 add_action( 'wp_enqueue_scripts', 'add_styls_orders_table_wp');48 /** 49 * Create meta boxes with options. 50 */ 51 new ot_meta_box(); 129 52 130 function orders_table_shortcode_show_post() { 131 ob_start(); 132 include_once('page-orders-table.php'); 133 $content = ob_get_clean(); 134 return $content; 135 } 136 137 add_shortcode( 'orders-table', 'orders_table_shortcode_show_post' ); 53 /** 54 * Includes scripts and styles plugin. 55 */ 56 new ot_includes(); 138 57 139 add_action( 'plugins_loaded', 'lang_load_plugin_ordes_table' ); 140 141 function lang_load_plugin_ordes_table() { 142 load_plugin_textdomain( 'orders-table', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 143 } 58 /** 59 * Create shortcode for diplay orders table. 60 */ 61 new ot_dislpay_front();
Note: See TracChangeset
for help on using the changeset viewer.