diff --git a/README.md b/README.md index ee17542..be191fb 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,11 @@ - [exemple of googlemap plugin creation](https://www.inkthemes.com/implement-google-map-plugin-for-wordpress/) - [Error: not a valid JSON response](https://wordpress.org/support/topic/publishing-failed-error-message-the-response-is-not-a-valid-json-response-2/) - [permalink broken](https://wordpress.org/support/topic/permalinks-change-breaks-all-links/) +- [console.log in php](https://stackify.com/how-to-log-to-console-in-php/) +- [plugins_url with symlink pbm](https://wordpress.stackexchange.com/questions/102681/plugins-url-file-wp-plugin-url-with-sym-links) +- [make nginx follow symlinks](https://unix.stackexchange.com/questions/157022/make-nginx-follow-symlinks) +- [nginx not following symlink maybe due to permissions](https://stackoverflow.com/questions/12624358/nginx-not-following-symlinks) +- [symlink pbm with php-fpm](https://joshtronic.com/2019/07/29/symlinks-with-nginx-and-php-fpm/) --- --- diff --git a/srcs/plugins/google_map/index.php b/srcs/plugins/google_map/index.php index aed45a6..095c145 100755 --- a/srcs/plugins/google_map/index.php +++ b/srcs/plugins/google_map/index.php @@ -17,12 +17,26 @@ // - permalink broken : https://wordpress.org/support/topic/permalinks-change-breaks-all-links/ // - solution classic editor -> ok -add_action('admin_menu', 'ink_menu_page'); +// https://stackify.com/how-to-log-to-console-in-php/ +function console_log($output, $with_script_tags = true) { + $js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . + ');'; + if ($with_script_tags) { + $js_code = ''; + } + echo $js_code; +} +//add_action( "plugins_loaded", "plugin_path" ) ; +//function plugin_path(){ +// define( 'PLUGIN_DIR_PATH', dirname(__FILE__) ); +// define( 'PLUGIN_URL_PATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' ); +//} + +add_action('admin_menu', 'ink_menu_page'); function ink_menu_page() { add_menu_page('GM', 'Google Map', 'manage_options', 'gm_setting', 'ink_gm_setting', '', 120); } - function ink_gm_setting(){ ?>