Compare commits
	
		
			3 Commits
		
	
	
		
			53571362b7
			...
			197af28a18
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 197af28a18 | |||
| 
						
						
							
						
						97c06c18a4
	
				 | 
					
					
						|||
| 
						
						
							
						
						947a78b03a
	
				 | 
					
					
						
@@ -1,5 +1,8 @@
 | 
			
		||||
(function($) {
 | 
			
		||||
  console.log('Your plugin just got loaded on the admin page!');
 | 
			
		||||
  console.log('This is what you get as jQuery:', $);
 | 
			
		||||
  console.log('Here is what you set for nmspPluginAdminApi:', window.nmspPluginAdminApi);
 | 
			
		||||
}(window.jQuery));
 | 
			
		||||
(() => {
 | 
			
		||||
  // resources/admin/js/nmsp-plugin-name-admin.js
 | 
			
		||||
  (function($) {
 | 
			
		||||
    console.log("Your plugin just got loaded on the admin page!");
 | 
			
		||||
    console.log("This is what you get as jQuery:", $);
 | 
			
		||||
    console.log("Here is what you set for nmspPluginAdminApi:", window.nmspPluginAdminApi);
 | 
			
		||||
  })(window.jQuery);
 | 
			
		||||
})();
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,8 @@
 | 
			
		||||
(function($) {
 | 
			
		||||
  console.log('Your plugin just got loaded!');
 | 
			
		||||
  console.log('This is what you get as jQuery:', $);
 | 
			
		||||
  console.log('Here is what you set for nmspPluginApi:', window.nmspPluginApi);
 | 
			
		||||
}(window.jQuery));
 | 
			
		||||
(() => {
 | 
			
		||||
  // resources/front/js/nmsp-plugin-name.js
 | 
			
		||||
  (function($) {
 | 
			
		||||
    console.log("Your plugin just got loaded!");
 | 
			
		||||
    console.log("This is what you get as jQuery:", $);
 | 
			
		||||
    console.log("Here is what you set for nmspPluginApi:", window.nmspPluginApi);
 | 
			
		||||
  })(window.jQuery);
 | 
			
		||||
})();
 | 
			
		||||
 
 | 
			
		||||
@@ -11,6 +11,7 @@ class CustomPage {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Class constructor.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @package PluginNamespace\Front\CustomPage
 | 
			
		||||
	 * @since 1.0.0
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return void
 | 
			
		||||
@@ -22,6 +23,7 @@ class CustomPage {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Register and enqueue stylesheets and javascript files.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @package PluginNamespace\Front\CustomPage
 | 
			
		||||
	 * @since 1.0.0
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return void
 | 
			
		||||
@@ -42,14 +44,15 @@ class CustomPage {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Display a page in place of a shortcode.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @package PluginNamespace\Front\CustomPage
 | 
			
		||||
	 * @since 1.0.0
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param array  $attributes  Array of attributes on the shortcode string in the post body.
 | 
			
		||||
	 * @param string $content     (optional) Text content that is between opening and closing shortcodes.
 | 
			
		||||
	 * @param array<string, string>  $attributes  Array of attributes on the shortcode string in the post body.
 | 
			
		||||
	 * @param string|null $content     (optional) Text content that is between opening and closing shortcodes.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return string
 | 
			
		||||
	 */
 | 
			
		||||
	public function display_custom_page( array $attributes = array(), $content = null ) {
 | 
			
		||||
	public function display_custom_page( array $attributes = array(), ?string $content = null ): string {
 | 
			
		||||
		$data = array(
 | 
			
		||||
			'shortcode' => array(
 | 
			
		||||
				'attributes' => $attributes,
 | 
			
		||||
@@ -58,7 +61,9 @@ class CustomPage {
 | 
			
		||||
		);
 | 
			
		||||
 | 
			
		||||
		ob_start();
 | 
			
		||||
		// phpcs:disable
 | 
			
		||||
		echo nmsp_plugin_app()->blade->run( 'front.custom-page', $data );
 | 
			
		||||
		// phpcs:enable
 | 
			
		||||
		$output = ob_get_clean();
 | 
			
		||||
		return wp_kses_post( $output );
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										36545
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										36545
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										21
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								package.json
									
									
									
									
									
								
							@@ -13,26 +13,31 @@
 | 
			
		||||
    "url": "https://github.com/namespace/plugin-name/issues"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "watch": "node-sass resources/front/sass/nmsp-plugin-name.scss -o ./assets/css/ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
 | 
			
		||||
    "watch:css": "node-sass resources/front/sass/nmsp-plugin-name.scss -o ./assets/css/ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
 | 
			
		||||
    "watch:css-admin": "node-sass resources/admin/sass/nmsp-plugin-name-admin.scss -o ./assets/css/ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
 | 
			
		||||
    "watch:js": "esbuild --format=iife resources/front/js/nmsp-plugin-name.js --outfile=assets/js/nmsp-plugin-name.js --bundle --watch",
 | 
			
		||||
    "watch:js-admin": "esbuild --format=iife resources/admin/js/nmsp-plugin-name-admin.js --outfile=assets/js/nmsp-plugin-name-admin.js --bundle --watch",
 | 
			
		||||
    "watch-admin": "node-sass resources/admin/sass/nmsp-plugin-name-admin.scss -o ./assets/css/ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
 | 
			
		||||
    "watch": "concurrently --kill-others \"npm run watch:css\" \"npm run watch:css-admin\" \"npm run watch:js\" \"npm run watch:js-admin\"",
 | 
			
		||||
    "compile:css": "node-sass resources/front/sass/nmsp-plugin-name.scss -o ./assets/css/ && stylelint 'assets/css/nmsp-plugin-name.css' --fix || true && stylelint 'assets/css/nmsp-plugin-name.css' --fix",
 | 
			
		||||
    "compile:css-admin": "node-sass resources/admin/sass/nmsp-plugin-name-admin.scss -o ./assets/css/ && stylelint 'assets/css/nmsp-plugin-name-admin.css' --fix || true && stylelint 'assets/css/nmsp-plugin-name-admin.css' --fix",
 | 
			
		||||
    "compile:rtl": "rtlcss assets/css/nmsp-plugin-name.css assets/css/nmsp-plugin-name-rtl.css && rtlcss assets/css/nmsp-plugin-name.css assets/css/nmsp-plugin-name-rtl.css",
 | 
			
		||||
    "compile:rtl-admin": "rtlcss assets/css/nmsp-plugin-name-admin.css assets/css/nmsp-plugin-name-admin-rtl.css && rtlcss assets/css/nmsp-plugin-name-admin-admin.css assets/css/nmsp-plugin-name-admin-rtl.css",
 | 
			
		||||
    "compile:js": "cp resources/front/js/nmsp-plugin-name.js assets/js/nmsp-plugin-name.js",
 | 
			
		||||
    "compile:js-admin": "cp resources/admin/js/nmsp-plugin-name-admin.js assets/js/nmsp-plugin-name-admin.js",
 | 
			
		||||
    "compile": "npm run compile:css && npm run compile:css-admin && npm run compile:rtl && npm run compile:rtl-admin && npm run compile:js && npm run compile:js-admin",
 | 
			
		||||
    "compile": "concurrently --kill-others \"npm run compile:css\" \"npm run compile:css-admin\" \"npm run compile:rtl\" \"npm run compile:rtl-admin\" \"npm run compile:js\" \"npm run compile:js-admin\"",
 | 
			
		||||
    "lint:js": "wp-scripts lint-js 'resources/**/js/*.js'",
 | 
			
		||||
    "lint:scss": "wp-scripts lint-style 'resources/**/sass/**/*.scss'",
 | 
			
		||||
    "bundle": "dir-archiver --src . --dest ../nmsp-plugin-name.zip --exclude .DS_Store .stylelintrc.json .eslintrc .git .gitattributes .github .gitignore README.md CHANGELOG.md composer.lock node_modules vendor package-lock.json package.json .travis.yml phpcs.xml.dist resources assets/css/nmsp-plugin-name.css.map assets/css/nmsp-plugin-name-admin.css.map"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {},
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@wordpress/scripts": "^16.1.1",
 | 
			
		||||
    "@wordpress/stylelint-config": "19.0.5",
 | 
			
		||||
    "dir-archiver": "^1.2.0",
 | 
			
		||||
    "node-sass": "^6.0.0",
 | 
			
		||||
    "rtlcss": "^3.2.0"
 | 
			
		||||
    "@wordpress/scripts": "^24.2.0",
 | 
			
		||||
    "@wordpress/stylelint-config": "21.1.0",
 | 
			
		||||
    "concurrently": "^7.4.0",
 | 
			
		||||
    "dir-archiver": "^2.0.0",
 | 
			
		||||
    "esbuild": "^0.15.10",
 | 
			
		||||
    "node-sass": "^7.0.3",
 | 
			
		||||
    "rtlcss": "^4.0.0"
 | 
			
		||||
  },
 | 
			
		||||
  "rtlcssConfig": {
 | 
			
		||||
    "options": {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user