diff --git a/admin/class-reuna-glossario-admin.php b/admin/class-reuna-glossario-admin.php index 7ffcc83..74873dc 100644 --- a/admin/class-reuna-glossario-admin.php +++ b/admin/class-reuna-glossario-admin.php @@ -73,6 +73,11 @@ class Reuna_Glossario_Admin { { } + /** + * Register the custom post type to contain the Glossario. + * + * @since 1.0.0 + */ public function register_glossario_post_type() { register_extended_post_type('glossario', [ @@ -109,12 +114,23 @@ class Reuna_Glossario_Admin { ]); } + /** + * Display the shortcode associated to a Glossario post below its title + * in the edit screen. + * + * @since 1.0.0 + */ public function display_term_shortcode_after_title() { global $post; require (plugin_dir_path(__FILE__) . 'partials/shortcode-metabox.php'); } + /** + * Add the post_title_like argument to WP_Query + * + * @since 1.0.0 + */ public function wp_query_by_post_title_like($where, $wp_query) { global $wpdb; diff --git a/admin/js/reuna-glossario-admin.js b/admin/js/reuna-glossario-admin.js deleted file mode 100644 index b04717f..0000000 --- a/admin/js/reuna-glossario-admin.js +++ /dev/null @@ -1,32 +0,0 @@ -(function( $ ) { - 'use strict'; - - /** - * All of the code for your admin-facing JavaScript source - * should reside in this file. - * - * Note: It has been assumed you will write jQuery code here, so the - * $ function reference has been prepared for usage within the scope - * of this function. - * - * This enables you to define handlers, for when the DOM is ready: - * - * $(function() { - * - * }); - * - * When the window is loaded: - * - * $( window ).load(function() { - * - * }); - * - * ...and/or other possibilities. - * - * Ideally, it is not considered best practise to attach more than a - * single DOM-ready or window-load handler for a particular page. - * Although scripts in the WordPress core, Plugins and Themes may be - * practising this, we should strive to set a better example in our own work. - */ - -})( jQuery ); diff --git a/admin/partials/shortcode-metabox.php b/admin/partials/shortcode-metabox.php index 36cb60c..4b05060 100644 --- a/admin/partials/shortcode-metabox.php +++ b/admin/partials/shortcode-metabox.php @@ -1,7 +1,7 @@ plugin_name, plugin_dir_url( __FILE__ ) . 'dist/css/glossario.css', [], $this->version, 'all' ); } + /** + * Register the [glossario] shortcode. + * + * @since 1.0.0 + */ public function register_glossario_shortcode() { add_shortcode('glossario', array($this, 'handle_glossario_shortcode')); } + /** + * Handle the [glossario] shortcode. + * + * @since 1.0.0 + */ public function handle_glossario_shortcode($atts, $content = null) { $atts = shortcode_atts([ @@ -100,6 +110,11 @@ class Reuna_Glossario_Public { return ob_get_clean(); } + /** + * Output the glossario post modal + * + * @since 1.0.0 + */ public function output_glossario_post_modal($post) { add_action('get_footer', function() use ($post) { diff --git a/public/dist/css/glossario.css b/public/dist/css/glossario.css index 2634564..302295b 100644 --- a/public/dist/css/glossario.css +++ b/public/dist/css/glossario.css @@ -1 +1 @@ -.rg-container{width:100%}@media (min-width:640px){.rg-container{max-width:640px}}@media (min-width:768px){.rg-container{max-width:768px}}@media (min-width:1024px){.rg-container{max-width:1024px}}@media (min-width:1280px){.rg-container{max-width:1280px}}.rg-bg-yellow-100{--bg-opacity:1!important;background-color:#faf9f5!important;background-color:rgba(250,249,245,var(--bg-opacity))!important}.rg-border-red-400{--border-opacity:1!important;border-color:#ff746e!important;border-color:rgba(255,116,110,var(--border-opacity))!important}.rg-border-l-8{border-left-width:8px!important}.rg-cursor-pointer{cursor:pointer!important}.rg-font-bold{font-weight:700!important}.rg-h-full{height:100%!important}.rg-text-xl{font-size:1.25rem!important}.rg-text-2xl{font-size:1.5rem!important}.rg-leading-tight{line-height:1.25!important}.rg-mt-2{margin-top:.5rem!important}.rg-mr-2{margin-right:.5rem!important}.rg-mt-5{margin-top:1.25rem!important}.rg-max-w-2xl{max-width:42rem!important}.hover\:rg-opacity-75:hover{opacity:.75!important}.rg-overflow-y-auto{overflow-y:auto!important}.rg-overflow-x-hidden{overflow-x:hidden!important}.rg-px-3{padding-left:.75rem!important;padding-right:.75rem!important}.rg-px-4{padding-left:1rem!important;padding-right:1rem!important}.rg-py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.rg-pt-4{padding-top:1rem!important}.rg-fixed{position:fixed!important}.rg-absolute{position:absolute!important}.rg-relative{position:relative!important}.rg-inset-0{right:0!important;bottom:0!important;left:0!important}.rg-inset-0,.rg-top-0{top:0!important}.rg-right-0{right:0!important}.rg-text-red-400{--text-opacity:1!important;color:#ff746e!important;color:rgba(255,116,110,var(--text-opacity))!important}.hover\:rg-underline:hover{text-decoration:underline!important}.rg-w-full{width:100%!important}.rg-z-40{z-index:40!important}@media (min-width:1024px){.lg\:rg-py-8{padding-top:2rem!important;padding-bottom:2rem!important}.lg\:rg-px-12{padding-left:3rem!important;padding-right:3rem!important}} \ No newline at end of file +.rg-container{width:100%}@media (min-width:640px){.rg-container{max-width:640px}}@media (min-width:768px){.rg-container{max-width:768px}}@media (min-width:1024px){.rg-container{max-width:1024px}}@media (min-width:1280px){.rg-container{max-width:1280px}}.rg-bg-yellow-100{--bg-opacity:1!important;background-color:#faf9f5!important;background-color:rgba(250,249,245,var(--bg-opacity))!important}.rg-border-red-400{--border-opacity:1!important;border-color:#ff746e!important;border-color:rgba(255,116,110,var(--border-opacity))!important}.rg-border-l-8{border-left-width:8px!important}.rg-font-bold{font-weight:700!important}.rg-h-full{height:100%!important}.rg-text-xl{font-size:1.25rem!important}.rg-text-2xl{font-size:1.5rem!important}.rg-leading-tight{line-height:1.25!important}.rg-mt-2{margin-top:.5rem!important}.rg-mr-2{margin-right:.5rem!important}.rg-mt-5{margin-top:1.25rem!important}.rg-max-w-2xl{max-width:42rem!important}.hover\:rg-opacity-75:hover{opacity:.75!important}.rg-overflow-y-auto{overflow-y:auto!important}.rg-overflow-x-hidden{overflow-x:hidden!important}.rg-px-3{padding-left:.75rem!important;padding-right:.75rem!important}.rg-px-4{padding-left:1rem!important;padding-right:1rem!important}.rg-py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.rg-pt-4{padding-top:1rem!important}.rg-fixed{position:fixed!important}.rg-absolute{position:absolute!important}.rg-relative{position:relative!important}.rg-inset-0{right:0!important;bottom:0!important;left:0!important}.rg-inset-0,.rg-top-0{top:0!important}.rg-right-0{right:0!important}.rg-text-red-400{--text-opacity:1!important;color:#ff746e!important;color:rgba(255,116,110,var(--text-opacity))!important}.rg-w-full{width:100%!important}.rg-z-40{z-index:40!important}@media (min-width:1024px){.lg\:rg-py-8{padding-top:2rem!important;padding-bottom:2rem!important}.lg\:rg-px-12{padding-left:3rem!important;padding-right:3rem!important}} \ No newline at end of file diff --git a/public/views/post-modal.php b/public/views/post-modal.php index 6e77f66..ae43708 100644 --- a/public/views/post-modal.php +++ b/public/views/post-modal.php @@ -1,15 +1,13 @@ -