Plugin Directory

Changeset 2015672


Ignore:
Timestamp:
01/20/2019 09:13:07 AM (7 years ago)
Author:
Somonator
Message:

update plugin

Location:
orders-table
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orders-table/trunk/Readme.txt

    r1477216 r2015672  
    11=== Orders Table ===
    22Contributors: Somonator
    3 Tags: post, edit, order
     3Tags: order, post
    44Requires at least: 3.0
    5 Tested up to: 4.6
     5Tested up to: 4.9.9
    66Stable tag: 1.0
    77
     
    1212
    1313== Installation ==
    14 1) Install this plugin.
    15 
    16 2) Add shortcode in tour page ([orders-table])
    17 
    18 3) Well done!
     141. Install this plugin.
     152. Add shortcode in tour page ([orders-table])
     163. Configure the plugin and fields as you need
     173. Well done!
    1918
    2019== 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).
    2225
    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).
    2626== Screenshots ==
    27 1. Admin of orders table
    28 2. Archive of orders table
     271. Orders
     281. Options plugin
     292. View orders table
    2930
    3031== Changelog ==
    31321.0 Release
     331.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  
    11<?php
    22/*
    3 Plugin Name: Orders Table
    4 Plugin URI: none
    5 Description: Plugin to create a order table
    6 Version: 1.0
    7 Author: Somonator
    8 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:
    99*/
    1010
    11 /*  Copyright 2016  Alexsandr  (email: somonator@gmail.com)
     11/* 
     12    Copyright 2016  Alexsandr (email: somonator@gmail.com)
    1213
    1314    This program is free software; you can redistribute it and/or modify
     
    2627*/
    2728
    28 if ( ! defined( 'ABSPATH' ) ) exit;
     29if (!defined('ABSPATH')) exit;
    2930
    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 }
     31require_once('inc/functions.php');
    7832
    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*/
     36new ot_post_type();
    9037
    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*/
     41new ot_new_post_status();
    11042
    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*/
     46new ot_option_page();
    12447
    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*/
     51new ot_meta_box();
    12952
    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*/
     56new ot_includes();
    13857
    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*/
     61new ot_dislpay_front();
Note: See TracChangeset for help on using the changeset viewer.