Changeset 2303235
- Timestamp:
- 05/12/2020 08:17:03 AM (6 years ago)
- Location:
- wha-crossword/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
wha-crossword.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wha-crossword/trunk/readme.txt
r2297593 r2303235 2 2 === Crossword Puzzles game === 3 3 Contributors: webhelpagency 4 Version: 1.1. 74 Version: 1.1.8 5 5 Donate link: http://webhelpagency.com/ 6 6 Tags: crossword, game, mind, puzzles -
wha-crossword/trunk/wha-crossword.php
r2297593 r2303235 4 4 * Plugin Name: WHA Crossword 5 5 * Description: The plugin creates an easy crossword from the words of any combination. 6 * Version: 1.1. 76 * Version: 1.1.8 7 7 * Author: WHA 8 8 * Author URI: http://webhelpagency.com/ … … 28 28 29 29 if (!defined('ABSPATH')) { 30 exit; // Exit if accessed directly30 exit; 31 31 } 32 32 … … 40 40 41 41 42 function crossword_activation() 43 { 44 } 42 function crossword_activation() {} 45 43 46 44 register_activation_hook(__FILE__, 'crossword_activation'); 47 45 48 function crossword_deactivation() 49 { 50 } 46 function crossword_deactivation() {} 51 47 52 48 register_deactivation_hook(__FILE__, 'crossword_deactivation'); 53 49 54 function wha_crossword_load_plugin_textdomain() 55 { 50 function wha_crossword_load_plugin_textdomain() { 56 51 load_plugin_textdomain('wha-crossword', FALSE, basename(dirname(__FILE__)) . 'res/languages'); 57 52 } … … 62 57 // Add scripts & styles 63 58 add_action('admin_enqueue_scripts', 'whacw_action_admin'); 64 function whacw_action_admin($hook_suffix) 65 { 59 function whacw_action_admin($hook_suffix) { 66 60 67 61 global $post; … … 84 78 // Register scripts and styles 85 79 add_action('wp_enqueue_scripts', 'whacw_setup_wdscript'); 86 function whacw_setup_wdscript() 87 { 80 function whacw_setup_wdscript() { 88 81 89 82 global $post; … … 117 110 // Initialization post type 118 111 add_action('init', 'whacw_register_post_type'); 119 function whacw_register_post_type() 120 { 112 function whacw_register_post_type() { 121 113 122 114 $labels = array( … … 159 151 // Create crossword page 160 152 add_filter('the_content', 'whacw_create_crossword_page'); 161 function whacw_create_crossword_page($content) 162 { 153 function whacw_create_crossword_page($content) { 163 154 164 155 global $post; … … 179 170 180 171 // Create shortcode crossword 181 function whacw_whagamecrossword_func($atts) 182 { 172 function whacw_whagamecrossword_func($atts) { 183 173 184 174 if (!isset($atts['id'])) { … … 238 228 $html .= '<div id="modal_form_crossword"> 239 229 <span id="modal_close">X</span> 240 <div class="content">' . $message. '</div>230 <div class="content">' . do_shortcode($message) . '</div> 241 231 </div> 242 232 <div id="overlay"></div>'; … … 250 240 // Add Crossword option box 251 241 add_action('add_meta_boxes', 'whacw_add_custom_box_shortcode', 10); 252 function whacw_add_custom_box_shortcode() 253 { 242 function whacw_add_custom_box_shortcode() { 254 243 $screens = array('wha_crossword'); 255 244 add_meta_box('myplugin_sectionid_shortcode', __('CROSSWORD SHORTCODE:','wha-crossword'), 'whacw_meta_box_shortcode_callback', $screens, 'advanced', 'high'); 256 245 } 257 246 258 function whacw_meta_box_shortcode_callback($post, $meta) 259 { 247 function whacw_meta_box_shortcode_callback($post, $meta) { 260 248 $screens = $meta['args']; 261 249 … … 268 256 // Add Crossword option box 269 257 add_action('add_meta_boxes', 'whacw_add_custom_box', 20); 270 function whacw_add_custom_box() 271 { 258 function whacw_add_custom_box() { 272 259 $screens = array('wha_crossword'); 273 260 add_meta_box('myplugin_sectionid', __('CROSSWORD: CLUE AND WORD','wha-crossword'), 'whacw_meta_box_callback', $screens, 'advanced', 'low'); 274 261 } 275 262 276 function whacw_meta_box_callback($post, $meta) 277 { 263 function whacw_meta_box_callback($post, $meta) { 278 264 279 265 $screens = $meta['args']; … … 303 289 // Add Crossword option box 304 290 add_action('add_meta_boxes', 'whacw_add_option_box', 30); 305 function whacw_add_option_box() 306 { 291 function whacw_add_option_box() { 307 292 308 293 $screens = array('wha_crossword'); … … 310 295 } 311 296 312 function whacw_option_box_callback($post, $meta) 313 { 297 function whacw_option_box_callback($post, $meta) { 314 298 315 299 $screens = $meta['args']; … … 448 432 449 433 echo '<div class="editor_individual_wrap"><h2>' . __('Congratulations text', 'wha-crossword') . '</h2>'; 450 $message = !empty(get_post_meta($post->ID, 'whacw_congratulations_individual', true)) ? get_post_meta($post->ID, 'whacw_congratulations_individual', true) : 'Congratulations individual!'; 434 $message = !empty(get_post_meta($post->ID, 'whacw_congratulations_individual', true)) ? 435 get_post_meta($post->ID, 'whacw_congratulations_individual', true) : 'Congratulations individual!'; 451 436 /* Individual congratulations text */ 452 437 wp_editor($message, 'whacw_congratulations_individual', $settings = array( … … 462 447 // Save data 463 448 add_action('save_post', 'whacw_save_postdata'); 464 function whacw_save_postdata($post_id) 465 { 466 449 function whacw_save_postdata($post_id) { 467 450 468 451 if (!wp_verify_nonce($_POST['myplugin_noncename'], plugin_basename(__FILE__))) … … 522 505 523 506 // Settings page 524 function whacw_register_settings() 525 { 507 function whacw_register_settings() { 526 508 527 509 add_option('whacw_option_bg_color', 'crossword backgroundg color'); … … 554 536 555 537 // Create submenu in admin panel 556 function whacw_register_options_page() 557 { 538 function whacw_register_options_page() { 558 539 559 540 add_submenu_page('edit.php?post_type=wha_crossword', … … 745 726 add_action('add_meta_boxes', 'whacs_sidebar_meta_box', 2); 746 727 747 748 function whacs_sidebar_meta_box_callback($post, $meta) // Call Areachart option fields and save 749 { 728 // Call Areachart option fields and save 729 function whacs_sidebar_meta_box_callback($post, $meta) { 750 730 $item = ''; 751 731 $item .= '<h1>Plugin Developed by</h1>'; … … 771 751 echo $item; 772 752 } 753
Note: See TracChangeset
for help on using the changeset viewer.