'None' ); foreach ( $se_list as $se ) { $se_options[ $se['tag'] ] = $se['translated']; } shortcode_ui_register_for_shortcode( 'wpstatistics', array( // Display label. String. Required. 'label' => 'WP Statistics', // Icon/image for shortcode. Optional. src or dashicons-$icon. Defaults to carrot. 'listItemImage' => '', // Available shortcode attributes and default values. Required. Array. // Attribute model expects 'attr', 'type' and 'label' // Supported field types: text, checkbox, textarea, radio, select, email, url, number, and date. 'attrs' => array( array( 'label' => __( 'Statistic', 'wp-statistics' ), 'attr' => 'stat', 'type' => 'select', 'description' => __( 'Select the statistic you wish to display.', 'wp-statistics' ), 'value' => 'usersonline', 'options' => array( 'usersonline' => __( 'Online Users', 'wp-statistics' ), 'visits' => __( 'Visits', 'wp-statistics' ), 'visitors' => __( 'Visitors', 'wp-statistics' ), 'pagevisits' => __( 'Page Visits', 'wp-statistics' ), 'searches' => __( 'Searches', 'wp-statistics' ), 'postcount' => __( 'Post Count', 'wp-statistics' ), 'pagecount' => __( 'Page Count', 'wp-statistics' ), 'commentcount' => __( 'Comment Count', 'wp-statistics' ), 'spamcount' => __( 'Spam Count', 'wp-statistics' ), 'usercount' => __( 'User Count', 'wp-statistics' ), 'postaverage' => __( 'Post Average', 'wp-statistics' ), 'commentaverage' => __( 'Comment Average', 'wp-statistics' ), 'useraverage' => __( 'User Average', 'wp-statistics' ), 'lpd' => __( 'Last Post Date', 'wp-statistics' ), ), ), array( 'label' => __( 'Time Frame', 'wp-statistics' ), 'attr' => 'time', 'type' => 'url', 'description' => __( 'The time frame to get the statistic for, strtotime() (http://php.net/manual/en/datetime.formats.php) will be used to calculate it. Use "total" to get all recorded dates.', 'wp-statistics' ), 'meta' => array( 'size' => '10' ), ), array( 'label' => __( 'Search Provider', 'wp-statistics' ), 'attr' => 'provider', 'type' => 'select', 'description' => __( 'The search provider to get statistics on.', 'wp-statistics' ), 'options' => $se_options, ), array( 'label' => __( 'Number Format', 'wp-statistics' ), 'attr' => 'format', 'type' => 'select', 'description' => __( 'The format to display numbers in: i18n, english, none.', 'wp-statistics' ), 'value' => 'none', 'options' => array( 'none' => __( 'None', 'wp-statistics' ), 'english' => __( 'English', 'wp-statistics' ), 'i18n' => __( 'International', 'wp-statistics' ), ), ), array( 'label' => __( 'Post/Page ID', 'wp-statistics' ), 'attr' => 'id', 'type' => 'number', 'description' => __( 'The post/page id to get page statistics on.', 'wp-statistics' ), 'meta' => array( 'size' => '5' ), ), ), ) ); } } }