diff --git a/README.md b/README.md
index 73a2389..b2a5175 100755
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ This would add the `dx_add_JS` function do the hook responsible for adding scrip
public function dx_add_JS() {
wp_enqueue_script( 'jquery' );
// load custom JSes and put them in footer
- wp_register_script( 'samplescript', plugins_url( '/js/samplescript.js' , __FILE__ ), array('jquery'), '1.0', true );
+ wp_register_script( 'samplescript', $this->url_assets . 'js/samplescript.js', array('jquery'), '1.0', true );
wp_enqueue_script( 'samplescript' );
}
```
@@ -47,7 +47,7 @@ Calling a function for your backend is similar:
```php
public function dx_add_admin_JS( $hook ) {
wp_enqueue_script( 'jquery' );
- wp_register_script( 'samplescript-admin', plugins_url( '/js/samplescript-admin.js' , __FILE__ ), array('jquery'), '1.0', true );
+ wp_register_script( 'samplescript-admin', $this->url_assets . 'js/samplescript-admin.js', array('jquery'), '1.0', true );
wp_enqueue_script( 'samplescript-admin' );
}
```
@@ -72,10 +72,10 @@ Then, you can call the `wp_enqueue_style` function within your callback method i
```php
public function dx_add_admin_CSS( $hook ) {
- wp_register_style( 'samplestyle-admin', plugins_url( '/css/samplestyle-admin.css', __FILE__ ), array(), '1.0', 'screen' );
+ wp_register_style( 'samplestyle-admin', $this->url_assets . '/css/samplestyle-admin.css', array(), '1.0', 'screen' );
wp_enqueue_style( 'samplestyle-admin' );
if( 'toplevel_page_dx-plugin-base' === $hook ) {
- wp_register_style('dx_help_page', plugins_url( '/help-page.css', __FILE__ ) );
+ wp_register_style('dx_help_page', $this->url_assets . '/help-page.css' );
wp_enqueue_style('dx_help_page');
}
}
@@ -95,20 +95,22 @@ Then you can add top level or submenu pages to your dashboard menu:
```php
public function dx_admin_pages_callback() {
- add_menu_page(__( "Plugin Base Admin", 'dxbase' ), __( "Plugin Base Admin", 'dxbase' ), 'edit_themes', 'dx-plugin-base', array( $this, 'dx_plugin_base' ) );
- add_submenu_page( 'dx-plugin-base', __( "Base Subpage", 'dxbase' ), __( "Base Subpage", 'dxbase' ), 'edit_themes', 'dx-base-subpage', array( $this, 'dx_plugin_subpage' ) );
- add_submenu_page( 'dx-plugin-base', __( "Remote Subpage", 'dxbase' ), __( "Remote Subpage", 'dxbase' ), 'edit_themes', 'dx-remote-subpage', array( $this, 'dx_plugin_side_access_page' ) );
+ add_menu_page(__( "Plugin Base Admin", DXP_TD ), __( "Plugin Base Admin", DXP_TD ), 'edit_themes', 'dx-plugin-base', array( $this, 'dx_plugin_base' ) );
+ add_submenu_page( 'dx-plugin-base', __( "Base Subpage", DXP_TD ), __( "Base Subpage", DXP_TD ), 'edit_themes', 'dx-base-subpage', array( $this, 'dx_plugin_subpage' ) );
+ add_submenu_page( 'dx-plugin-base', __( "Remote Subpage", DXP_TD ), __( "Remote Subpage", DXP_TD ), 'edit_themes', 'dx-remote-subpage', array( $this, 'dx_plugin_side_access_page' ) );
}
```
It's up to you what would you hook exactly and what would be the capabilities required for your users, but that's the sample syntax that you'd need. Each of those pages is defined via a callback at the end of the function parameters list, that could either be plain HTML/PHP, or loading an external file including your logic:
```php
- // Earlier in your plugin header
- define( 'DXP_PATH_INCLUDES', dirname( __FILE__ ) . '/inc' );
+ // Earlier in your plugin setup
+ if( empty( $this->path_template ) ):
+ $this->path_template = trailingslashit( $this->path . 'template' );
+ endif;
// A class method for the callback
public function dx_plugin_side_access_page() {
- include_once( DXP_PATH_INCLUDES . '/remote-page-template.php' );
+ include_once( $this->path_template . 'remote-page-template.php' );
}
```
@@ -126,18 +128,18 @@ The function responsible for the registration has plenty of options to play with
public function dx_custom_post_types_callback() {
register_post_type( 'pluginbase', array(
'labels' => array(
- 'name' => __("Base Items", 'dxbase'),
- 'singular_name' => __("Base Item", 'dxbase'),
- 'add_new' => _x("Add New", 'pluginbase', 'dxbase' ),
- 'add_new_item' => __("Add New Base Item", 'dxbase' ),
- 'edit_item' => __("Edit Base Item", 'dxbase' ),
- 'new_item' => __("New Base Item", 'dxbase' ),
- 'view_item' => __("View Base Item", 'dxbase' ),
- 'search_items' => __("Search Base Items", 'dxbase' ),
- 'not_found' => __("No base items found", 'dxbase' ),
- 'not_found_in_trash' => __("No base items found in Trash", 'dxbase' ),
+ 'name' => __("Base Items", DXP_TD),
+ 'singular_name' => __("Base Item", DXP_TD),
+ 'add_new' => _x("Add New", 'pluginbase', DXP_TD ),
+ 'add_new_item' => __("Add New Base Item", DXP_TD ),
+ 'edit_item' => __("Edit Base Item", DXP_TD ),
+ 'new_item' => __("New Base Item", DXP_TD ),
+ 'view_item' => __("View Base Item", DXP_TD ),
+ 'search_items' => __("Search Base Items", DXP_TD ),
+ 'not_found' => __("No base items found", DXP_TD ),
+ 'not_found_in_trash' => __("No base items found in Trash", DXP_TD ),
),
- 'description' => __("Base Items for the demo", 'dxbase'),
+ 'description' => __("Base Items for the demo", DXP_TD),
'public' => true,
'publicly_queryable' => true,
'query_var' => true,
@@ -177,20 +179,20 @@ Then, our callback is registering the custom taxonomy and binds it so a custom p
register_taxonomy( 'pluginbase_taxonomy', 'pluginbase', array(
'hierarchical' => true,
'labels' => array(
- 'name' => _x( "Base Item Taxonomies", 'taxonomy general name', 'dxbase' ),
- 'singular_name' => _x( "Base Item Taxonomy", 'taxonomy singular name', 'dxbase' ),
- 'search_items' => __( "Search Taxonomies", 'dxbase' ),
- 'popular_items' => __( "Popular Taxonomies", 'dxbase' ),
- 'all_items' => __( "All Taxonomies", 'dxbase' ),
+ 'name' => _x( "Base Item Taxonomies", 'taxonomy general name', DXP_TD ),
+ 'singular_name' => _x( "Base Item Taxonomy", 'taxonomy singular name', DXP_TD ),
+ 'search_items' => __( "Search Taxonomies", DXP_TD ),
+ 'popular_items' => __( "Popular Taxonomies", DXP_TD ),
+ 'all_items' => __( "All Taxonomies", DXP_TD ),
'parent_item' => null,
'parent_item_colon' => null,
- 'edit_item' => __( "Edit Base Item Taxonomy", 'dxbase' ),
- 'update_item' => __( "Update Base Item Taxonomy", 'dxbase' ),
- 'add_new_item' => __( "Add New Base Item Taxonomy", 'dxbase' ),
- 'new_item_name' => __( "New Base Item Taxonomy Name", 'dxbase' ),
- 'separate_items_with_commas' => __( "Separate Base Item taxonomies with commas", 'dxbase' ),
- 'add_or_remove_items' => __( "Add or remove Base Item taxonomy", 'dxbase' ),
- 'choose_from_most_used' => __( "Choose from the most used Base Item taxonomies", 'dxbase' )
+ 'edit_item' => __( "Edit Base Item Taxonomy", DXP_TD ),
+ 'update_item' => __( "Update Base Item Taxonomy", DXP_TD ),
+ 'add_new_item' => __( "Add New Base Item Taxonomy", DXP_TD ),
+ 'new_item_name' => __( "New Base Item Taxonomy Name", DXP_TD ),
+ 'separate_items_with_commas' => __( "Separate Base Item taxonomies with commas", DXP_TD ),
+ 'add_or_remove_items' => __( "Add or remove Base Item taxonomy", DXP_TD ),
+ 'choose_from_most_used' => __( "Choose from the most used Base Item taxonomies", DXP_TD )
),
'show_ui' => true,
'query_var' => true,
@@ -218,7 +220,7 @@ Our callback method will register the metaboxes that we need, attached to a spec
// register side box
add_meta_box(
'dx_side_meta_box',
- __( "DX Side Box", 'dxbase' ),
+ __( "DX Side Box", DXP_TD ),
array( $this, 'dx_side_meta_box' ),
'pluginbase', // leave empty quotes as '' if you want it on all custom post add/edit screens
'side',
@@ -228,7 +230,7 @@ Our callback method will register the metaboxes that we need, attached to a spec
// register bottom box
add_meta_box(
'dx_bottom_meta_box',
- __( "DX Bottom Box", 'dxbase' ),
+ __( "DX Bottom Box", DXP_TD ),
array( $this, 'dx_bottom_meta_box' ),
'' // leave empty quotes as '' if you want it on all custom post add/edit screens or add a post type slug
);
@@ -239,7 +241,7 @@ The callback of our `add_meta_box` call includes everything that is to be displa
```php
public function dx_side_meta_box( $post, $metabox) {
- _e("
Side meta content here
", 'dxbase');
+ _e("
Side meta content here
", DXP_TD);
// Add some test data here - a custom field, that is
$dx_test_input = '';
@@ -248,7 +250,7 @@ The callback of our `add_meta_box` call includes everything that is to be displa
$dx_test_input = get_post_meta( $post->ID, 'dx_test_input', true );
}
?>
-
+
path_include . 'dx-sample-widget.class.php';
}
```
@@ -341,6 +343,16 @@ The shortcode callback can interact with WordPress and all underlying APIs and r
[sample_shortcode arg1="first" arg2="second"]content[/sample_shortcode]
```
+Also You can add another shortcodes in shortcode like:
+
+```php
+ [dxsampcode]
+ [dxsampcode_wp_query]Query Title[/dxsampcode_wp_query]
+ [dxsampcode_wp_user_query]User Query Title[/dxsampcode_wp_user_query]
+ [dxsampcode_wp_meta_query]Meta Query Title[/dxsampcode_wp_meta_query]
+ [/dxsampcode]
+```
+
Arguments are available in the `$attr` array - the first argument of the callback, and a `$content` is also provided if you wrap a chunk of text with your shortcode opening and closing tags.
```php
@@ -353,7 +365,194 @@ Arguments are available in the `$attr` array - the first argument of the callbac
/*
* Manage the attributes and the content as per your request and return the result
*/
- return __( 'Sample Output', 'dxbase');
+ ob_start();
+ ?>
+
+
+
+```
+ And
+
+```php
+ " />
+```
+
+Thats hooks can be called from the plugin or theme functions.php.
+
+For example
+
+```php
+ add_action( 'dx_base_page_template_form_before_settings', array( $this, 'base_page_template_form_before' ) );
+```
+
+And the callback for the hook
+
+```php
+ public function base_page_template_form_before() {
+ _e( 'Sample example, of adding a custom hook. This will add conternt before form elements.', DXP_TD );
+ }
+```
+
+Also there are can be changed the submit button value (text)
+
+```php
+ add_filter( 'dx_base_page_template_form_submit_button', array( $this, 'base_page_template_form_submit_button' ) );
+```
+The callback
+
+```php
+ public function base_page_template_form_submit_button( $value ) {
+ return __( 'Save settings', DXP_TD );
}
```
diff --git a/assets/css/help-page.css b/assets/css/help-page.css
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/assets/css/help-page.css
@@ -0,0 +1 @@
+
diff --git a/assets/css/index.php b/assets/css/index.php
new file mode 100644
index 0000000..6220032
--- /dev/null
+++ b/assets/css/index.php
@@ -0,0 +1,2 @@
+setup();
+
+ // add script and style calls the WP way
+ // it's a bit confusing as styles are called with a scripts hook
+ // @blamenacin - http://make.wordpress.org/core/2011/12/12/use-wp_enqueue_scripts-not-wp_print_styles-to-enqueue-scripts-and-styles-for-the-frontend/
+ add_action( 'wp_enqueue_scripts', array( $this, 'dx_add_JS' ) );
+ add_action( 'wp_enqueue_scripts', array( $this, 'dx_add_CSS' ) );
+
+ // add scripts and styles only available in admin
add_action( 'admin_enqueue_scripts', array( $this, 'dx_add_admin_JS' ) );
- add_action( 'admin_enqueue_scripts', array( $this, 'dx_add_admin_CSS' ) );
-
- // register admin pages for the plugin
- add_action( 'admin_menu', array( $this, 'dx_admin_pages_callback' ) );
-
- // register meta boxes for Pages (could be replicated for posts and custom post types)
- add_action( 'add_meta_boxes', array( $this, 'dx_meta_boxes_callback' ) );
-
- // register save_post hooks for saving the custom fields
- add_action( 'save_post', array( $this, 'dx_save_sample_field' ) );
-
- // Register custom post types and taxonomies
- add_action( 'init', array( $this, 'dx_custom_post_types_callback' ), 5 );
- add_action( 'init', array( $this, 'dx_custom_taxonomies_callback' ), 6 );
-
- // Register activation and deactivation hooks
- register_activation_hook( __FILE__, 'dx_on_activate_callback' );
- register_deactivation_hook( __FILE__, 'dx_on_deactivate_callback' );
-
- // Translation-ready
- add_action( 'plugins_loaded', array( $this, 'dx_add_textdomain' ) );
-
- // Add earlier execution as it needs to occur before admin page display
- add_action( 'admin_init', array( $this, 'dx_register_settings' ), 5 );
-
- // Add a sample shortcode
- add_action( 'init', array( $this, 'dx_sample_shortcode' ) );
-
- // Add a sample widget
- add_action( 'widgets_init', array( $this, 'dx_sample_widget' ) );
-
- /*
- * TODO:
- * template_redirect
- */
-
- // Add actions for storing value and fetching URL
- // use the wp_ajax_nopriv_ hook for non-logged users (handle guest actions)
- add_action( 'wp_ajax_store_ajax_value', array( $this, 'store_ajax_value' ) );
- add_action( 'wp_ajax_fetch_ajax_url_http', array( $this, 'fetch_ajax_url_http' ) );
-
- }
-
- /**
- *
- * Adding JavaScript scripts
- *
- * Loading existing scripts from wp-includes or adding custom ones
- *
- */
- public function dx_add_JS() {
- wp_enqueue_script( 'jquery' );
- // load custom JSes and put them in footer
- wp_register_script( 'samplescript', plugins_url( '/js/samplescript.js' , __FILE__ ), array('jquery'), '1.0', true );
- wp_enqueue_script( 'samplescript' );
- }
-
-
+ add_action( 'admin_enqueue_scripts', array( $this, 'dx_add_admin_CSS' ) );
+ // register admin pages for the plugin
+ add_action( 'admin_menu', array( $this, 'dx_admin_pages_callback' ) );
+
+ // register meta boxes for Pages (could be replicated for posts and custom post types)
+ add_action( 'add_meta_boxes', array( $this, 'dx_meta_boxes_callback' ) );
+
+ // register save_post hooks for saving the custom fields
+ add_action( 'save_post', array( $this, 'dx_save_sample_field' ) );
+
+ // Register custom post types and taxonomies
+ add_action( 'init', array( $this, 'dx_custom_post_types_callback' ), 5 );
+ add_action( 'init', array( $this, 'dx_custom_taxonomies_callback' ), 6 );
+
+ // Translation-ready
+ add_action( 'plugins_loaded', array( $this, 'dx_add_textdomain' ) );
+
+ // Add earlier execution as it needs to occur before admin page display
+ add_action( 'admin_init', array( $this, 'dx_register_settings' ), 5 );
+
+ // Add a sample shortcode
+ add_action( 'init', array( $this, 'dx_sample_shortcode' ) );
+
+ // Add a sample widget
+ add_action( 'widgets_init', array( $this, 'dx_sample_widget' ) );
+
+ /*
+ * TODO:
+ * template_redirect
+ */
+
+ // Add actions for storing value and fetching URL
+ // use the wp_ajax_nopriv_ hook for non-logged users (handle guest actions)
+ add_action( 'wp_ajax_store_ajax_value', array( $this, 'store_ajax_value' ) );
+ add_action( 'wp_ajax_fetch_ajax_url_http', array( $this, 'fetch_ajax_url_http' ) );
+
+ //hook to the base page setting page form , and add content in form before and after the elements
+ add_action( 'dx_base_page_template_form_before_settings', array( $this, 'base_page_template_form_before' ) );
+ add_action( 'dx_base_page_template_form_after_settings', array( $this, 'base_page_template_form_after' ) );
+
+ //change the to the base page setting page form submit button text (value)
+ add_filter( 'dx_base_page_template_form_submit_button', array( $this, 'base_page_template_form_submit_button' ) );
+ }
+
+ /**
+ * Setup the plugin main properties
+ */
+ protected function setup() {
+ //check all properties, if they are empty assign data accordingly
+ if ( empty( $this->version ) ):
+ $this->version = '1.7';
+ endif;
+ if( empty( $this->path ) ):
+ $this->path = trailingslashit( dirname( __FILE__ ) );
+ endif;
+ if( empty( $this->path_include ) ):
+ $this->path_include = trailingslashit( $this->path . 'inc' );
+ endif;
+ if( empty( $this->path_template ) ):
+ $this->path_template = trailingslashit( $this->path . 'template' );
+ endif;
+ if( empty( $this->url ) ):
+ $this->url = trailingslashit( plugins_url( '', __FILE__ ) );
+ endif;
+ if( empty( $this->url_assets ) ):
+ $this->url_assets = trailingslashit( $this->url . 'assets' );
+ endif;
+ }
+
+ /**
+ * Adding the content in form before it elemnts
+ */
+ public function base_page_template_form_before() {
+ _e( 'Sample example, of adding a custom hook. This will add content before form elements.', DXP_TD );
+ }
+
+ /**
+ * Adding the content in form after it elemnts
+ */
+ public function base_page_template_form_after() {
+ _e( 'Sample example, of adding a custom hook. This will add content after form elements.', DXP_TD );
+ echo ' ';
+ }
+
+ /**
+ * Callback for the filter the submit button text in base page template
+ *
+ * @param string $value
+ * @return string The new value of the submit button
+ */
+ public function base_page_template_form_submit_button( $value ) {
+ return __( 'Save settings', DXP_TD );
+ }
+
+ /**
+ *
+ * Adding JavaScript scripts
+ *
+ * Loading existing scripts from wp-includes or adding custom ones
+ *
+ */
+ public function dx_add_JS() {
+ wp_enqueue_script( 'jquery' );
+ // load custom JSes and put them in footer
+ wp_register_script( 'samplescript', $this->url_assets . 'js/samplescript.js', array('jquery'), '1.0', true );
+ wp_enqueue_script( 'samplescript' );
+ }
+
+
/**
*
* Adding JavaScript scripts for the admin pages only
*
* Loading existing scripts from wp-includes or adding custom ones
*
- */
- public function dx_add_admin_JS( $hook ) {
- wp_enqueue_script( 'jquery' );
- wp_register_script( 'samplescript-admin', plugins_url( '/js/samplescript-admin.js' , __FILE__ ), array('jquery'), '1.0', true );
- wp_enqueue_script( 'samplescript-admin' );
- }
-
- /**
- *
- * Add CSS styles
- *
- */
- public function dx_add_CSS() {
- wp_register_style( 'samplestyle', plugins_url( '/css/samplestyle.css', __FILE__ ), array(), '1.0', 'screen' );
- wp_enqueue_style( 'samplestyle' );
- }
-
+ */
+ public function dx_add_admin_JS( $hook ) {
+ wp_enqueue_script( 'jquery' );
+ wp_register_script( 'samplescript-admin', $this->url_assets . 'js/samplescript-admin.js' , array('jquery'), '1.0', true );
+ wp_enqueue_script( 'samplescript-admin' );
+ }
+
+ /**
+ *
+ * Add CSS styles
+ *
+ */
+ public function dx_add_CSS() {
+ wp_register_style( 'samplestyle', $this->url_assets . 'css/samplestyle.css', array(), '1.0', 'screen' );
+ wp_enqueue_style( 'samplestyle' );
+ }
+
/**
*
* Add admin CSS styles - available only on admin
*
- */
- public function dx_add_admin_CSS( $hook ) {
- wp_register_style( 'samplestyle-admin', plugins_url( '/css/samplestyle-admin.css', __FILE__ ), array(), '1.0', 'screen' );
- wp_enqueue_style( 'samplestyle-admin' );
-
- if( 'toplevel_page_dx-plugin-base' === $hook ) {
- wp_register_style('dx_help_page', plugins_url( '/help-page.css', __FILE__ ) );
- wp_enqueue_style('dx_help_page');
- }
- }
-
- /**
- *
- * Callback for registering pages
- *
- * This demo registers a custom page for the plugin and a subpage
- *
- */
- public function dx_admin_pages_callback() {
- add_menu_page(__( "Plugin Base Admin", 'dxbase' ), __( "Plugin Base Admin", 'dxbase' ), 'edit_themes', 'dx-plugin-base', array( $this, 'dx_plugin_base' ) );
- add_submenu_page( 'dx-plugin-base', __( "Base Subpage", 'dxbase' ), __( "Base Subpage", 'dxbase' ), 'edit_themes', 'dx-base-subpage', array( $this, 'dx_plugin_subpage' ) );
- add_submenu_page( 'dx-plugin-base', __( "Remote Subpage", 'dxbase' ), __( "Remote Subpage", 'dxbase' ), 'edit_themes', 'dx-remote-subpage', array( $this, 'dx_plugin_side_access_page' ) );
- }
-
- /**
- *
- * The content of the base page
- *
- */
- public function dx_plugin_base() {
- include_once( DXP_PATH_INCLUDES . '/base-page-template.php' );
- }
-
- public function dx_plugin_side_access_page() {
- include_once( DXP_PATH_INCLUDES . '/remote-page-template.php' );
- }
-
- /**
- *
- * The content of the subpage
- *
- * Use some default UI from WordPress guidelines echoed here (the sample above is with a template)
- *
- * @see http://www.onextrapixel.com/2009/07/01/how-to-design-and-style-your-wordpress-plugin-admin-panel/
- *
- */
- public function dx_plugin_subpage() {
- echo '
';
- _e( "
DX Plugin Subpage
", 'dxbase' );
- _e( "I'm a subpage and I know it!", 'dxbase' );
- echo '
';
- }
-
- /**
- *
- * Adding right and bottom meta boxes to Pages
- *
- */
- public function dx_meta_boxes_callback() {
- // register side box
- add_meta_box(
- 'dx_side_meta_box',
- __( "DX Side Box", 'dxbase' ),
- array( $this, 'dx_side_meta_box' ),
- 'pluginbase', // leave empty quotes as '' if you want it on all custom post add/edit screens
- 'side',
- 'high'
- );
-
- // register bottom box
- add_meta_box(
- 'dx_bottom_meta_box',
- __( "DX Bottom Box", 'dxbase' ),
- array( $this, 'dx_bottom_meta_box' ),
- '' // leave empty quotes as '' if you want it on all custom post add/edit screens or add a post type slug
- );
- }
-
- /**
- *
- * Init right side meta box here
- * @param post $post the post object of the given page
- * @param metabox $metabox metabox data
- */
- public function dx_side_meta_box( $post, $metabox) {
- _e("
Side meta content here
", 'dxbase');
-
- // Add some test data here - a custom field, that is
- $dx_test_input = '';
- if ( ! empty ( $post ) ) {
- // Read the database record if we've saved that before
- $dx_test_input = get_post_meta( $post->ID, 'dx_test_input', true );
- }
- ?>
-
-
- Bottom meta content here", 'dxbase' );
- }
-
- /**
- * Register custom post types
- *
- */
- public function dx_custom_post_types_callback() {
- register_post_type( 'pluginbase', array(
- 'labels' => array(
- 'name' => __("Base Items", 'dxbase'),
- 'singular_name' => __("Base Item", 'dxbase'),
- 'add_new' => _x("Add New", 'pluginbase', 'dxbase' ),
- 'add_new_item' => __("Add New Base Item", 'dxbase' ),
- 'edit_item' => __("Edit Base Item", 'dxbase' ),
- 'new_item' => __("New Base Item", 'dxbase' ),
- 'view_item' => __("View Base Item", 'dxbase' ),
- 'search_items' => __("Search Base Items", 'dxbase' ),
- 'not_found' => __("No base items found", 'dxbase' ),
- 'not_found_in_trash' => __("No base items found in Trash", 'dxbase' ),
- ),
- 'description' => __("Base Items for the demo", 'dxbase'),
- 'public' => true,
- 'publicly_queryable' => true,
- 'query_var' => true,
- 'rewrite' => true,
- 'exclude_from_search' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 40, // probably have to change, many plugins use this
- 'supports' => array(
- 'title',
- 'editor',
- 'thumbnail',
- 'custom-fields',
- 'page-attributes',
- ),
- 'taxonomies' => array( 'post_tag' )
- ));
- }
-
-
- /**
- * Register custom taxonomies
- *
- */
- public function dx_custom_taxonomies_callback() {
- register_taxonomy( 'pluginbase_taxonomy', 'pluginbase', array(
- 'hierarchical' => true,
- 'labels' => array(
- 'name' => _x( "Base Item Taxonomies", 'taxonomy general name', 'dxbase' ),
- 'singular_name' => _x( "Base Item Taxonomy", 'taxonomy singular name', 'dxbase' ),
- 'search_items' => __( "Search Taxonomies", 'dxbase' ),
- 'popular_items' => __( "Popular Taxonomies", 'dxbase' ),
- 'all_items' => __( "All Taxonomies", 'dxbase' ),
- 'parent_item' => null,
- 'parent_item_colon' => null,
- 'edit_item' => __( "Edit Base Item Taxonomy", 'dxbase' ),
- 'update_item' => __( "Update Base Item Taxonomy", 'dxbase' ),
- 'add_new_item' => __( "Add New Base Item Taxonomy", 'dxbase' ),
- 'new_item_name' => __( "New Base Item Taxonomy Name", 'dxbase' ),
- 'separate_items_with_commas' => __( "Separate Base Item taxonomies with commas", 'dxbase' ),
- 'add_or_remove_items' => __( "Add or remove Base Item taxonomy", 'dxbase' ),
- 'choose_from_most_used' => __( "Choose from the most used Base Item taxonomies", 'dxbase' )
- ),
- 'show_ui' => true,
- 'query_var' => true,
- 'rewrite' => true,
- ));
-
- register_taxonomy_for_object_type( 'pluginbase_taxonomy', 'pluginbase' );
- }
-
- /**
- * Initialize the Settings class
- *
- * Register a settings section with a field for a secure WordPress admin option creation.
- *
- */
- public function dx_register_settings() {
- require_once( DXP_PATH . '/dx-plugin-settings.class.php' );
- new DX_Plugin_Settings();
- }
-
- /**
- * Register a sample shortcode to be used
- *
- * First parameter is the shortcode name, would be used like: [dxsampcode]
- *
- */
- public function dx_sample_shortcode() {
- add_shortcode( 'dxsampcode', array( $this, 'dx_sample_shortcode_body' ) );
- }
-
- /**
- * Returns the content of the sample shortcode, like [dxsamplcode]
- * @param array $attr arguments passed to array, like [dxsamcode attr1="one" attr2="two"]
- * @param string $content optional, could be used for a content to be wrapped, such as [dxsamcode]somecontnet[/dxsamcode]
- */
- public function dx_sample_shortcode_body( $attr, $content = null ) {
- /*
- * Manage the attributes and the content as per your request and return the result
- */
- return __( 'Sample Output', 'dxbase');
- }
-
- /**
- * Hook for including a sample widget with options
- */
- public function dx_sample_widget() {
- include_once DXP_PATH_INCLUDES . '/dx-sample-widget.class.php';
- }
-
- /**
- * Add textdomain for plugin
- */
- public function dx_add_textdomain() {
- load_plugin_textdomain( 'dxbase', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
- }
-
- /**
- * Callback for saving a simple AJAX option with no page reload
- */
- public function store_ajax_value() {
- if( isset( $_POST['data'] ) && isset( $_POST['data']['dx_option_from_ajax'] ) ) {
- update_option( 'dx_option_from_ajax' , $_POST['data']['dx_option_from_ajax'] );
- }
- die();
- }
-
- /**
- * Callback for getting a URL and fetching it's content in the admin page
- */
- public function fetch_ajax_url_http() {
+ */
+ public function dx_add_admin_CSS( $hook ) {
+ wp_register_style( 'samplestyle-admin', $this->url_assets . 'css/samplestyle-admin.css', array(), '1.0', 'screen' );
+ wp_enqueue_style( 'samplestyle-admin' );
+
+ if( 'toplevel_page_dx-plugin-base' === $hook ) {
+ wp_register_style('dx_help_page', $this->url_assets . 'css/help-page.css' );
+ wp_enqueue_style('dx_help_page');
+ }
+ }
+
+ /**
+ *
+ * Callback for registering pages
+ *
+ * This demo registers a custom page for the plugin and a subpage
+ *
+ */
+ public function dx_admin_pages_callback() {
+ add_menu_page(__( "Plugin Base Admin", DXP_TD ), __( "Plugin Base Admin", DXP_TD ), 'edit_themes', 'dx-plugin-base', array( $this, 'dx_plugin_base' ) );
+ add_submenu_page( 'dx-plugin-base', __( "Base Subpage", DXP_TD ), __( "Base Subpage", DXP_TD ), 'edit_themes', 'dx-base-subpage', array( $this, 'dx_plugin_subpage' ) );
+ add_submenu_page( 'dx-plugin-base', __( "Remote Subpage", DXP_TD ), __( "Remote Subpage", DXP_TD ), 'edit_themes', 'dx-remote-subpage', array( $this, 'dx_plugin_side_access_page' ) );
+
+ /**
+ * Add options page
+ * @todo change me
+ */
+ add_options_page( __( 'Options of base plugin', DXP_TD ), __( 'Base Plugin options', DXP_TD ), 'manage_options', 'dx_base_plugin_options', array( $this, 'dx_base_plugin_options_cb' ) );
+ }
+
+ /**
+ *
+ * The content of the base page
+ *
+ */
+ public function dx_plugin_base() {
+ include_once( $this->path_template . 'base-page-template.php' );
+ }
+
+ public function dx_plugin_side_access_page() {
+ include_once( $this->path_template . 'remote-page-template.php' );
+ }
+
+ /**
+ * Callback for the add options page
+ *
+ * @since 1.7
+ */
+ public function dx_base_plugin_options_cb() {
+ ?>
+
+ ';
+ _e( "
DX Plugin Subpage
", DXP_TD );
+ _e( "I'm a subpage and I know it!", DXP_TD );
+ echo '';
+ }
+
+ /**
+ *
+ * Adding right and bottom meta boxes to Pages
+ *
+ */
+ public function dx_meta_boxes_callback() {
+ // register side box
+ add_meta_box(
+ 'dx_side_meta_box',
+ __( "DX Side Box", DXP_TD ),
+ array( $this, 'dx_side_meta_box' ),
+ 'pluginbase', // leave empty quotes as '' if you want it on all custom post add/edit screens
+ 'side',
+ 'high'
+ );
+
+ // register bottom box
+ add_meta_box(
+ 'dx_bottom_meta_box',
+ __( "DX Bottom Box", DXP_TD ),
+ array( $this, 'dx_bottom_meta_box' ),
+ '' // leave empty quotes as '' if you want it on all custom post add/edit screens or add a post type slug
+ );
+ }
+
+ /**
+ *
+ * Init right side meta box here
+ * @param post $post the post object of the given page
+ * @param metabox $metabox metabox data
+ */
+ public function dx_side_meta_box( $post, $metabox) {
+ _e("
Side meta content here
", DXP_TD);
+
+ // Add some test data here - a custom field, that is
+ $dx_test_input = '';
+ if ( ! empty ( $post ) ) {
+ // Read the database record if we've saved that before
+ $dx_test_input = get_post_meta( $post->ID, 'dx_test_input', true );
+ }
+ ?>
+
+
+ Bottom meta content here", DXP_TD );
+ }
+
+ /**
+ * Register custom post types
+ *
+ */
+ public function dx_custom_post_types_callback() {
+ register_post_type( 'pluginbase', array(
+ 'labels' => array(
+ 'name' => __("Base Items", DXP_TD),
+ 'singular_name' => __("Base Item", DXP_TD),
+ 'add_new' => _x("Add New", 'pluginbase', DXP_TD ),
+ 'add_new_item' => __("Add New Base Item", DXP_TD ),
+ 'edit_item' => __("Edit Base Item", DXP_TD ),
+ 'new_item' => __("New Base Item", DXP_TD ),
+ 'view_item' => __("View Base Item", DXP_TD ),
+ 'search_items' => __("Search Base Items", DXP_TD ),
+ 'not_found' => __("No base items found", DXP_TD ),
+ 'not_found_in_trash' => __("No base items found in Trash", DXP_TD ),
+ ),
+ 'description' => __("Base Items for the demo", DXP_TD),
+ 'public' => true,
+ 'publicly_queryable' => true,
+ 'query_var' => true,
+ 'rewrite' => true,
+ 'exclude_from_search' => true,
+ 'show_ui' => true,
+ 'show_in_menu' => true,
+ 'menu_position' => 40, // probably have to change, many plugins use this
+ 'supports' => array(
+ 'title',
+ 'editor',
+ 'thumbnail',
+ 'custom-fields',
+ 'page-attributes',
+ ),
+ 'taxonomies' => array( 'post_tag' )
+ ));
+ }
+
+
+ /**
+ * Register custom taxonomies
+ *
+ */
+ public function dx_custom_taxonomies_callback() {
+ register_taxonomy( 'pluginbase_taxonomy', 'pluginbase', array(
+ 'hierarchical' => true,
+ 'labels' => array(
+ 'name' => _x( "Base Item Taxonomies", 'taxonomy general name', DXP_TD ),
+ 'singular_name' => _x( "Base Item Taxonomy", 'taxonomy singular name', DXP_TD ),
+ 'search_items' => __( "Search Taxonomies", DXP_TD ),
+ 'popular_items' => __( "Popular Taxonomies", DXP_TD ),
+ 'all_items' => __( "All Taxonomies", DXP_TD ),
+ 'parent_item' => null,
+ 'parent_item_colon' => null,
+ 'edit_item' => __( "Edit Base Item Taxonomy", DXP_TD ),
+ 'update_item' => __( "Update Base Item Taxonomy", DXP_TD ),
+ 'add_new_item' => __( "Add New Base Item Taxonomy", DXP_TD ),
+ 'new_item_name' => __( "New Base Item Taxonomy Name", DXP_TD ),
+ 'separate_items_with_commas' => __( "Separate Base Item taxonomies with commas", DXP_TD ),
+ 'add_or_remove_items' => __( "Add or remove Base Item taxonomy", DXP_TD ),
+ 'choose_from_most_used' => __( "Choose from the most used Base Item taxonomies", DXP_TD )
+ ),
+ 'show_ui' => true,
+ 'query_var' => true,
+ 'rewrite' => true,
+ ));
+
+ register_taxonomy_for_object_type( 'pluginbase_taxonomy', 'pluginbase' );
+ }
+
+ /**
+ * Initialize the Settings class
+ *
+ * Register a settings section with a field for a secure WordPress admin option creation.
+ *
+ */
+ public function dx_register_settings() {
+ require_once( $this->path_include . '/class-dx-plugin-settings.php' );
+ new DX_Plugin_Settings();
+ }
+
+ /**
+ * Register a sample shortcode to be used
+ *
+ * First parameter is the shortcode name, would be used like: [dxsampcode]
+ *
+ */
+ public function dx_sample_shortcode() {
+ add_shortcode( 'dxsampcode', array( $this, 'dx_sample_shortcode_body' ) );
+ add_shortcode( 'dxsampcode_wp_query', array( $this, 'dx_sample_shortcode_wp_query_body' ) );
+ add_shortcode( 'dxsampcode_wp_user_query', array( $this, 'dx_sample_shortcode_wp_user_query_body' ) );
+ add_shortcode( 'dxsampcode_wp_meta_query', array( $this, 'dx_sample_shortcode_wp_meta_query_body' ) );
+ }
+
+ /**
+ * Returns the content of the sample shortcode, like [dxsamplcode]
+ * @param array $attr arguments passed to array, like [dxsamcode attr1="one" attr2="two"]
+ * @param string $content optional, could be used for a content to be wrapped, such as [dxsamcode]somecontnet[/dxsamcode]
+ */
+ public function dx_sample_shortcode_body( $attr, $content = null ) {
+ /*
+ * Manage the attributes and the content as per your request and return the result
+ */
+ ob_start();
+ ?>
+
+
+ path_include . 'dx-sample-widget.class.php';
+ }
+
+ /**
+ * Add textdomain for plugin
+ */
+ public function dx_add_textdomain() {
+ load_plugin_textdomain( DXP_TD, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
+ }
+
+ /**
+ * Callback for saving a simple AJAX option with no page reload
+ */
+ public function store_ajax_value() {
+ if( isset( $_POST['data'] ) && isset( $_POST['data']['dx_option_from_ajax'] ) ) {
+ update_option( 'dx_option_from_ajax' , $_POST['data']['dx_option_from_ajax'] );
+ }
+ die();
+ }
+
+ /**
+ * Callback for getting a URL and fetching it's content in the admin page
+ */
+ public function fetch_ajax_url_http() {
if( isset( $_POST['data'] ) && isset( $_POST['data']['dx_url_for_ajax'] ) ) {
- $ajax_url = $_POST['data']['dx_url_for_ajax'];
-
- $response = wp_remote_get( $ajax_url );
-
- if( is_wp_error( $response ) ) {
- echo json_encode( __( 'Invalid HTTP resource', 'dxbase' ) );
- die();
- }
-
- if( isset( $response['body'] ) ) {
- if( preg_match( '/(.*)<\/title>/', $response['body'], $matches ) ) {
- echo json_encode( $matches[1] );
- die();
- }
+ $ajax_url = $_POST['data']['dx_url_for_ajax'];
+
+ $response = wp_remote_get( $ajax_url );
+
+ if( is_wp_error( $response ) ) {
+ echo json_encode( __( 'Invalid HTTP resource', DXP_TD ) );
+ die();
}
- }
- echo json_encode( __( 'No title found or site was not fetched properly', 'dxbase' ) );
- die();
- }
-
-}
-
+
+ if( isset( $response['body'] ) ) {
+ if( preg_match( '/(.*)<\/title>/', $response['body'], $matches ) ) {
+ echo json_encode( $matches[1] );
+ die();
+ }
+ }
+ }
+ echo json_encode( __( 'No title found or site was not fetched properly', DXP_TD ) );
+ die();
+ }
+
+}
+
/**
* Register activation hook
@@ -441,6 +681,7 @@ public function fetch_ajax_url_http() {
function dx_on_activate_callback() {
// do something on activation
}
+register_activation_hook( __FILE__, 'dx_on_activate_callback' );
/**
* Register deactivation hook
@@ -448,7 +689,17 @@ function dx_on_activate_callback() {
*/
function dx_on_deactivate_callback() {
// do something when deactivated
-}
-
-// Initialize everything
-$dx_plugin_base = new DX_Plugin_Base();
+}
+register_deactivation_hook( __FILE__, 'dx_on_deactivate_callback' );
+
+/**
+ * Register uninstall hook
+ *
+ */
+function dx_on_uninstall_callback(){
+ // do something when plugin is uninstalling
+}
+register_uninstall_hook( __FILE__, 'dx_on_uninstall_callback' );
+
+// Initialize everything
+$dx_plugin_base = new DX_Plugin_Base();
\ No newline at end of file
diff --git a/dx-plugin-settings.class.php b/dx-plugin-settings.class.php
deleted file mode 100755
index ca2485d..0000000
--- a/dx-plugin-settings.class.php
+++ /dev/null
@@ -1,113 +0,0 @@
-dx_setting = get_option( 'dx_setting', '' );
-
- // register the checkbox
- add_action('admin_init', array( $this, 'register_settings' ) );
- }
-
- /**
- * Setup the settings
- *
- * Add a single checkbox setting for Active/Inactive and a text field
- * just for the sake of our demo
- *
- */
- public function register_settings() {
- register_setting( 'dx_setting', 'dx_setting', array( $this, 'dx_validate_settings' ) );
-
- add_settings_section(
- 'dx_settings_section', // ID used to identify this section and with which to register options
- __( "Enable DX Templates", 'dxbase' ), // Title to be displayed on the administration page
- array($this, 'dx_settings_callback'), // Callback used to render the description of the section
- 'dx-plugin-base' // Page on which to add this section of options
- );
-
- add_settings_field(
- 'dx_opt_in', // ID used to identify the field throughout the theme
- __( "Active: ", 'dxbase' ), // The label to the left of the option interface element
- array( $this, 'dx_opt_in_callback' ), // The name of the function responsible for rendering the option interface
- 'dx-plugin-base', // The page on which this option will be displayed
- 'dx_settings_section' // The name of the section to which this field belongs
- );
-
- add_settings_field(
- 'dx_sample_text', // ID used to identify the field throughout the theme
- __( "DX Sample: ", 'dxbase' ), // The label to the left of the option interface element
- array( $this, 'dx_sample_text_callback' ), // The name of the function responsible for rendering the option interface
- 'dx-plugin-base', // The page on which this option will be displayed
- 'dx_settings_section' // The name of the section to which this field belongs
- );
- }
-
- public function dx_settings_callback() {
- echo _e( "Enable me", 'dxbase' );
- }
-
- public function dx_opt_in_callback() {
- $enabled = false;
- $out = '';
- $val = false;
-
- // check if checkbox is checked
- if(! empty( $this->dx_setting ) && isset ( $this->dx_setting['dx_opt_in'] ) ) {
- $val = true;
- }
-
- if($val) {
- $out = '';
- } else {
- $out = '';
- }
-
- echo $out;
- }
-
- public function dx_sample_text_callback() {
- $out = '';
- $val = '';
-
- // check if checkbox is checked
- if(! empty( $this->dx_setting ) && isset ( $this->dx_setting['dx_sample_text'] ) ) {
- $val = $this->dx_setting['dx_sample_text'];
- }
-
- $out = '';
-
- echo $out;
- }
-
- /**
- * Helper Settings function if you need a setting from the outside.
- *
- * Keep in mind that in our demo the Settings class is initialized in a specific environment and if you
- * want to make use of this function, you should initialize it earlier (before the base class)
- *
- * @return boolean is enabled
- */
- public function is_enabled() {
- if(! empty( $this->dx_setting ) && isset ( $this->dx_setting['dx_opt_in'] ) ) {
- return true;
- }
- return false;
- }
-
- /**
- * Validate Settings
- *
- * Filter the submitted data as per your request and return the array
- *
- * @param array $input
- */
- public function dx_validate_settings( $input ) {
-
- return $input;
- }
-}
diff --git a/inc/base-page-template.php b/inc/base-page-template.php
deleted file mode 100644
index d47cfc2..0000000
--- a/inc/base-page-template.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/inc/class-dx-plugin-settings.php b/inc/class-dx-plugin-settings.php
new file mode 100755
index 0000000..31fb049
--- /dev/null
+++ b/inc/class-dx-plugin-settings.php
@@ -0,0 +1,172 @@
+dx_setting = get_option( 'dx_setting', '' );
+
+ // register the checkbox
+ add_action('admin_init', array( $this, 'register_settings' ) );
+ }
+
+ /**
+ * Setup the settings
+ *
+ * Add a single checkbox setting for Active/Inactive and a text field
+ * just for the sake of our demo
+ *
+ */
+ public function register_settings() {
+ register_setting( 'dx_setting', 'dx_setting', array( $this, 'dx_validate_settings' ) );
+
+ add_settings_section(
+ 'dx_settings_section', // ID used to identify this section and with which to register options
+ __( "Enable DX Templates", DXP_TD ), // Title to be displayed on the administration page
+ array($this, 'dx_settings_callback'), // Callback used to render the description of the section
+ 'dx-plugin-base' // Page on which to add this section of options
+ );
+
+ add_settings_field(
+ 'dx_opt_in', // ID used to identify the field throughout the theme
+ __( "Active: ", DXP_TD ), // The label to the left of the option interface element
+ array( $this, 'dx_opt_in_callback' ), // The name of the function responsible for rendering the option interface
+ 'dx-plugin-base', // The page on which this option will be displayed
+ 'dx_settings_section' // The name of the section to which this field belongs
+ );
+
+ add_settings_field(
+ 'dx_sample_text', // ID used to identify the field throughout the theme
+ __( "DX Sample: ", DXP_TD ), // The label to the left of the option interface element
+ array( $this, 'dx_sample_text_callback' ), // The name of the function responsible for rendering the option interface
+ 'dx-plugin-base', // The page on which this option will be displayed
+ 'dx_settings_section' // The name of the section to which this field belongs
+ );
+ //options page settings
+ register_setting( 'dx_options_setting', 'dx_options_setting', array( $this, 'dx_options_settings_validate' ) );
+ add_settings_section(
+ 'dx_options_settings_section', // ID used to identify this section and with which to register options
+ __( "Plugin Base Options", DXP_TD ), // Title to be displayed on the administration page
+ array( $this, 'dx_options_settings_callback' ), // Callback used to render the description of the section
+ 'dx_base_plugin_options' // Page on which to add this section of options
+ );
+
+ add_settings_field(
+ 'dx_options_checkbox', // ID used to identify the field throughout the theme
+ __( "Checkbox: ", DXP_TD ), // The label to the left of the option interface element
+ array( $this, 'dx_options_checkbox_callback' ), // The name of the function responsible for rendering the option interface
+ 'dx_base_plugin_options', // The page on which this option will be displayed
+ 'dx_options_settings_section' // The name of the section to which this field belongs
+ );
+
+ add_settings_field(
+ 'dx_options_text', // ID used to identify the field throughout the theme
+ __( "DX Sample: ", DXP_TD ), // The label to the left of the option interface element
+ array( $this, 'dx_options_text_callback' ), // The name of the function responsible for rendering the option interface
+ 'dx_base_plugin_options', // The page on which this option will be displayed
+ 'dx_options_settings_section' // The name of the section to which this field belongs
+ );
+
+ }
+
+ public function dx_settings_callback() {
+ echo _e( "Enable me", DXP_TD );
+ }
+
+ public function dx_opt_in_callback() {
+ $enabled = false;
+ $out = '';
+ $val = false;
+
+ // check if checkbox is checked
+ if(! empty( $this->dx_setting ) && isset ( $this->dx_setting['dx_opt_in'] ) ) {
+ $val = true;
+ }
+
+ if($val) {
+ $out = '';
+ } else {
+ $out = '';
+ }
+
+ $out .= sprintf( '
', __( 'Input description text sample.', DXP_TD ) );
+
+ echo $out;
+ }
+
+ /**
+ * Helper Settings function if you need a setting from the outside.
+ *
+ * Keep in mind that in our demo the Settings class is initialized in a specific environment and if you
+ * want to make use of this function, you should initialize it earlier (before the base class)
+ *
+ * @return boolean is enabled
+ */
+ public function is_enabled() {
+ if(! empty( $this->dx_setting ) && isset ( $this->dx_setting['dx_opt_in'] ) ) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Validate Settings
+ *
+ * Filter the submitted data as per your request and return the array
+ *
+ * @param array $input
+ */
+ public function dx_validate_settings( $input ) {
+ array_walk_recursive($input, function( &$item, $key ){//senitizy the user input before saving to the DB
+ $item = esc_attr( $item );
+ });
+ return $input;
+ }
+
+ public function dx_options_settings_callback() {
+ _e( 'Options page settings', DXP_TD );
+ }
+
+ public function dx_options_checkbox_callback() {
+ $dx_options_setting = get_option( 'dx_options_setting' );
+ $checkbox = !empty( $dx_options_setting['dx_options_checkbox'] )? $dx_options_setting['dx_options_checkbox'] : '';
+ ?>
+ />
+
+
+
+
+ 'dx_widget_sample_single', 'description' => __( "Display a sample DX Widget", 'dxbase' ) ),
+ __("DX Sample Widget", DXP_TD),
+ array( 'classname' => 'dx_widget_sample_single', 'description' => __( "Display a sample DX Widget", DXP_TD ) ),
array( ) // you can pass width/height as parameters with values here
);
}
@@ -86,18 +86,18 @@ public function form ( $instance ) {
$sample_dropdown = esc_attr( $instance[ 'sample_dropdown' ] );
?>
-
-
+
+
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/template/index.php b/template/index.php
new file mode 100644
index 0000000..6220032
--- /dev/null
+++ b/template/index.php
@@ -0,0 +1,2 @@
+