Changeset 3365361
- Timestamp:
- 09/21/2025 05:33:56 PM (6 months ago)
- Location:
- digital-table-of-contents
- Files:
-
- 15 added
- 1 deleted
- 13 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-7.png (added)
-
assets/screenshot-8.png (added)
-
assets/screenshot-9.png (added)
-
tags/1.0.4/readme.md (deleted)
-
trunk/admin/class-digital-toc-settings.php (modified) (55 diffs)
-
trunk/admin/dashboard_page.php (modified) (3 diffs)
-
trunk/admin/misc.php (modified) (4 diffs)
-
trunk/assets/admin/css/admin.css (modified) (1 diff)
-
trunk/assets/admin/js/admin-floating.js (added)
-
trunk/assets/frontend/css/dtoc-floating.css (added)
-
trunk/assets/frontend/css/dtoc-incontent.css (added)
-
trunk/assets/frontend/css/dtoc-sliding-sticky-css-based.css (added)
-
trunk/assets/frontend/css/dtoc-sliding-sticky-js-based.css (added)
-
trunk/assets/frontend/css/dtoc-sliding-sticky-mobile.css (added)
-
trunk/assets/frontend/js/dtoc-sliding-sticky-mobile.js (added)
-
trunk/assets/frontend/js/dtoc_floating.js (added)
-
trunk/assets/frontend/js/dtoc_incontent.js (added)
-
trunk/digital-table-of-contents.php (modified) (3 diffs)
-
trunk/includes/floating/floating.php (modified) (2 diffs)
-
trunk/includes/generic_functions.php (modified) (1 diff)
-
trunk/includes/incontent/in-content-mobile.php (added)
-
trunk/includes/incontent/in-content.php (added)
-
trunk/includes/misc.php (modified) (5 diffs)
-
trunk/includes/sticky/sliding-sticky-mobile.php (added)
-
trunk/includes/sticky/sliding-sticky.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/shared/functions.php (modified) (6 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
digital-table-of-contents/trunk/admin/class-digital-toc-settings.php
r3361111 r3365361 27 27 [$this, 'dtoc_settings_page_render'] 28 28 ); 29 // add_submenu_page( 30 // 'dtoc', 31 // 'Digital Table of Contents In-Content', 32 // 'In-Content Mobile', 33 // 'manage_options', 34 // 'dtoc_incontent_mobile', 35 // [$this, 'dtoc_settings_page_render'] 36 // ); 37 // add_submenu_page( 38 // 'dtoc', 39 // 'Digital Table of Contents In-Content', 40 // 'In-Content Tablet', 41 // 'manage_options', 42 // 'dtoc_incontent_tablet', 43 // [$this, 'dtoc_settings_page_render'] 44 // ); 45 46 // add_submenu_page( 47 // 'dtoc', 48 // 'Digital Table of Contents Sticky', 49 // 'Sticky Mobile', 50 // 'manage_options', 51 // 'dtoc_sliding_sticky_mobile', 52 // [$this, 'dtoc_settings_page_render'] 53 // ); 54 // add_submenu_page( 55 // 'dtoc', 56 // 'Digital Table of Contents Sticky', 57 // 'Sticky Tablet', 58 // 'manage_options', 59 // 'dtoc_sliding_sticky_tablet', 60 // [$this, 'dtoc_settings_page_render'] 61 // ); 62 // add_submenu_page( 63 // 'dtoc', 64 // 'Digital Table of Contents Floating', 65 // 'Floating', 66 // 'manage_options', 67 // 'dtoc_floating', 68 // [$this, 'dtoc_settings_page_render'] 69 // ); 70 // add_submenu_page( 71 // 'dtoc', 72 // 'Digital Table of Contents Floating', 73 // 'Floating Mobile', 74 // 'manage_options', 75 // 'dtoc_floating_mobile', 76 // [$this, 'dtoc_settings_page_render'] 77 // ); 78 // add_submenu_page( 79 // 'dtoc', 80 // 'Digital Table of Contents Floating', 81 // 'Floating Tablet', 82 // 'manage_options', 83 // 'dtoc_floating_tablet', 84 // [$this, 'dtoc_settings_page_render'] 85 // ); 29 add_submenu_page( 30 'dtoc', 31 'Digital Table of Contents In-Content', 32 'In-Content Mobile', 33 'manage_options', 34 'dtoc_incontent_mobile', 35 [$this, 'dtoc_settings_page_render'] 36 ); 37 38 add_submenu_page( 39 'dtoc', 40 'Digital Table of Contents Floating', 41 'Floating', 42 'manage_options', 43 'dtoc_floating', 44 [$this, 'dtoc_settings_page_render'] 45 ); 86 46 add_submenu_page( 87 47 'dtoc', … … 100 60 [$this, 'dtoc_settings_page_render'] 101 61 ); 102 // add_submenu_page( 103 // 'dtoc', 104 // 'Digital Table of Contents Shortcode', 105 // 'Shortcode Mobile', 106 // 'manage_options', 107 // 'dtoc_shortcode_mobile', 108 // [$this, 'dtoc_settings_page_render'] 109 // ); 110 // add_submenu_page( 111 // 'dtoc', 112 // 'Digital Table of Contents Shortcode', 113 // 'Shortcode Tablet', 114 // 'manage_options', 115 // 'dtoc_shortcode_tablet', 116 // [$this, 'dtoc_settings_page_render'] 117 // ); 62 add_submenu_page( 63 'dtoc', 64 'Digital Table of Contents Sliding Sticky Mobile', 65 'Sliding Sticky Mobile', 66 'manage_options', 67 'dtoc_sliding_sticky_mobile', 68 [$this, 'dtoc_settings_page_render'] 69 ); 118 70 119 71 } … … 145 97 break; 146 98 case 'dtoc_sliding_sticky_mobile': 147 $this->_page_title = 'S ticky Mobile';99 $this->_page_title = 'Sliding Sticky Mobile'; 148 100 $this->_setting_option = $dtoc_sliding_sticky_mobile; 149 101 break; … … 368 320 369 321 $settings_groups = [ 370 'dtoc_incontent_group' => 'dtoc_incontent', 371 'dtoc_incontent_mobile_group' => 'dtoc_incontent_mobile', 372 'dtoc_incontent_tablet_group' => 'dtoc_incontent_tablet', 373 374 'dtoc_sliding_sticky_group' => 'dtoc_sliding_sticky', 375 'dtoc_sliding_sticky_mobile_group' => 'dtoc_sliding_sticky_mobile', 376 'dtoc_sliding_sticky_tablet_group' => 'dtoc_sliding_sticky_tablet', 377 378 'dtoc_floating_group' => 'dtoc_floating', 379 'dtoc_floating_mobile_group' => 'dtoc_floating_mobile', 380 'dtoc_floating_tablet_group' => 'dtoc_floating_tablet', 381 382 'dtoc_shortcode_group' => 'dtoc_shortcode', 383 'dtoc_shortcode_mobile_group' => 'dtoc_shortcode_mobile', 384 'dtoc_shortcode_tablet_group' => 'dtoc_shortcode_tablet', 322 'dtoc_incontent_group' => 'dtoc_incontent', 323 'dtoc_incontent_mobile_group' => 'dtoc_incontent_mobile', 324 'dtoc_sliding_sticky_group' => 'dtoc_sliding_sticky', 325 'dtoc_sliding_sticky_mobile_group' => 'dtoc_sliding_sticky_mobile', 326 'dtoc_floating_group' => 'dtoc_floating', 327 'dtoc_shortcode_group' => 'dtoc_shortcode', 385 328 ]; 386 329 … … 412 355 * --------------------------------- 413 356 * Settings Fields (generic config) 414 * Each field can define "pages" => [ 'dtoc_incontent', 'dtoc_sliding_sticky', ...]357 * Each field can define "pages" => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', ...] 415 358 * If "pages" not set, it will show everywhere. 416 359 * --------------------------------- … … 422 365 'callback' => 'dtoc_general_rendering_style_cb', 423 366 'section' => 'dtoc_general_setting_section', 424 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],367 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_sliding_sticky', 'dtoc_shortcode' ], 425 368 ], 426 369 'dtoc_display_title' => [ … … 428 371 'callback' => 'dtoc_display_title_cb', 429 372 'section' => 'dtoc_general_setting_section', 430 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],373 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_shortcode' ], 431 374 'args' => [ 'label_for' => 'display_title' ], 432 375 ], 433 'dtoc_general_header_text' => [376 'dtoc_general_header_text' => [ 434 377 'title' => __( 'Text', 'digital-table-of-contents' ), 435 378 'callback' => 'dtoc_general_header_text_cb', 436 379 'section' => 'dtoc_general_setting_section', 437 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],380 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_shortcode' ], 438 381 'args' => [ 'class' => 'dtoc_child_opt dtoc_display_title' ], 382 ], 383 'dtoc_general_header_text_sm' => [ 384 'title' => __( 'Title Text', 'digital-table-of-contents' ), 385 'callback' => 'dtoc_general_header_text_cb', 386 'section' => 'dtoc_general_setting_section', 387 'pages' => [ 'dtoc_sliding_sticky_mobile' ], 439 388 ], 440 389 'dtoc_display_toggle_body' => [ … … 442 391 'callback' => 'dtoc_display_toggle_body_cb', 443 392 'section' => 'dtoc_general_setting_section', 444 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],393 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_shortcode' ], 445 394 'args' => [ 446 395 'class' => 'dtoc_child_opt dtoc_display_title', … … 452 401 'callback' => 'dtoc_display_toggle_initial_cb', 453 402 'section' => 'dtoc_general_setting_section', 454 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],403 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_shortcode' ], 455 404 'args' => [ 456 405 'class' => 'dtoc_child_opt dtoc_2_label_child_opt dtoc_display_title', 457 406 ], 458 407 ], 459 'dtoc_display_toggle_initial ' => [408 'dtoc_display_toggle_initial_sm' => [ 460 409 'title' => __( 'Initial Body View', 'digital-table-of-contents' ), 461 410 'callback' => 'dtoc_display_toggle_initial_cb', 462 411 'section' => 'dtoc_general_setting_section', 463 'pages' => [ 'dtoc_sliding_sticky' ],412 'pages' => [ 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile' ], 464 413 ], 465 414 'dtoc_general_toggle_btn_text' => [ … … 473 422 'callback' => 'dtoc_general_header_icon_cb', 474 423 'section' => 'dtoc_general_setting_section', 475 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],424 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_shortcode' ], 476 425 'args' => [ 477 426 'class' => 'dtoc_child_opt dtoc_2_label_child_opt dtoc_display_title', … … 482 431 'callback' => 'dtoc_general_show_text_cb', 483 432 'section' => 'dtoc_general_setting_section', 484 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],433 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_shortcode' ], 485 434 'args' => [ 486 435 'class' => 'dtoc_child_opt dtoc_2_label_child_opt dtoc_3_label_child_opt dtoc_display_title', … … 491 440 'callback' => 'dtoc_general_hide_text_cb', 492 441 'section' => 'dtoc_general_setting_section', 493 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],442 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_shortcode' ], 494 443 'args' => [ 495 444 'class' => 'dtoc_child_opt dtoc_2_label_child_opt dtoc_3_label_child_opt dtoc_display_title', … … 500 449 'callback' => 'dtoc_general_jump_links_cb', 501 450 'section' => 'dtoc_general_setting_section', 502 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky','dtoc_shortcode' ],451 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 503 452 'args' => [ 504 453 'label_for' => 'jump_links', … … 509 458 'callback' => 'dtoc_general_scroll_behavior_cb', 510 459 'section' => 'dtoc_general_setting_section', 511 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],460 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 512 461 'args' => [ 513 462 'class' => 'dtoc_child_opt dtoc_jump_links', 514 463 ], 515 464 ], 516 'dtoc_general_scroll_back_to_toc' => [517 'title' => __( 'Scroll Back to TOC', 'digital-table-of-contents' ),518 'callback' => 'dtoc_general_scroll_back_to_toc_cb',519 'section' => 'dtoc_general_setting_section',520 'pages' => [ 'dtoc_incontent', 'dtoc_shortcode' ],521 'args' => [522 'label_for' => 'scroll_back_to_toc',523 'class' => 'dtoc_child_opt dtoc_jump_links',524 ],525 ],465 // 'dtoc_general_scroll_back_to_toc' => [ 466 // 'title' => __( 'Scroll Back to TOC', 'digital-table-of-contents' ), 467 // 'callback' => 'dtoc_general_scroll_back_to_toc_cb', 468 // 'section' => 'dtoc_general_setting_section', 469 // 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_shortcode' ], 470 // 'args' => [ 471 // 'label_for' => 'scroll_back_to_toc', 472 // 'class' => 'dtoc_child_opt dtoc_jump_links', 473 // ], 474 // ], 526 475 'dtoc_general_alignment' => [ 527 476 'title' => __( 'Alignment', 'digital-table-of-contents' ), 528 477 'callback' => 'dtoc_general_alignment_cb', 529 478 'section' => 'dtoc_general_setting_section', 530 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],479 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_shortcode' ], 531 480 ], 532 481 'dtoc_general_wrap_content' => [ … … 534 483 'callback' => 'dtoc_general_wrap_content_cb', 535 484 'section' => 'dtoc_general_setting_section', 536 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],485 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_shortcode' ], 537 486 'args' => [ 538 487 'label_for' => 'wrap_content', … … 543 492 'callback' => 'dtoc_general_when_cb', 544 493 'section' => 'dtoc_general_setting_section', 545 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],494 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 546 495 ], 547 496 'dtoc_position' => [ … … 549 498 'callback' => 'dtoc_general_position_cb', 550 499 'section' => 'dtoc_general_setting_section', 551 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],552 ], 553 'dtoc_position ' => [500 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_shortcode' ], 501 ], 502 'dtoc_position_ss' => [ 554 503 'title' => __( 'Position', 'digital-table-of-contents' ), 555 504 'callback' => 'dtoc_general_sticky_position_cb', … … 557 506 'pages' => [ 'dtoc_sliding_sticky'], 558 507 ], 508 'dtoc_position_sm' => [ 509 'title' => __( 'Position', 'digital-table-of-contents' ), 510 'callback' => 'dtoc_general_sticky_mobile_position_cb', 511 'section' => 'dtoc_general_setting_section', 512 'pages' => ['dtoc_sliding_sticky_mobile'], 513 ], 559 514 'dtoc_paragraph_number' => [ 560 515 'title' => __( 'Paragraph Number', 'digital-table-of-contents' ), 561 516 'callback' => 'dtoc_general_paragraph_number_cb', 562 517 'section' => 'dtoc_general_setting_section', 563 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],518 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 564 519 'args' => [ 565 520 'label_for' => 'paragraph_number', … … 571 526 'callback' => 'dtoc_general_list_style_type_cb', 572 527 'section' => 'dtoc_general_setting_section', 573 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],528 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 574 529 ], 575 530 'dtoc_general_headings_include' => [ … … 577 532 'callback' => 'dtoc_general_headings_include_cb', 578 533 'section' => 'dtoc_general_setting_section', 579 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],534 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky','dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 580 535 ], 581 536 'dtoc_customization_title_bg_color' => [ … … 583 538 'callback' => 'dtoc_customization_title_bg_color_cb', 584 539 'section' => 'dtoc_customization_title_section', 585 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],540 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 586 541 ], 587 542 'dtoc_customization_title_fg_color' => [ … … 589 544 'callback' => 'dtoc_customization_title_fg_color_cb', 590 545 'section' => 'dtoc_customization_title_section', 591 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],546 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 592 547 ], 593 548 'dtoc_customization_title_font_size' => [ … … 595 550 'callback' => 'dtoc_customization_title_font_size_cb', 596 551 'section' => 'dtoc_customization_title_section', 597 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],552 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 598 553 ], 599 554 'dtoc_customization_title_font_weight' => [ … … 601 556 'callback' => 'dtoc_customization_title_font_weight_cb', 602 557 'section' => 'dtoc_customization_title_section', 603 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],558 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 604 559 ], 605 560 'dtoc_customization_title_padding' => [ … … 607 562 'callback' => 'dtoc_customization_title_padding_cb', 608 563 'section' => 'dtoc_customization_title_section', 609 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],564 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 610 565 ], 611 566 'dtoc_customization_toggle_btn_bg_color' => [ … … 613 568 'callback' => 'dtoc_customization_toggle_btn_bg_color_cb', 614 569 'section' => 'dtoc_customization_toggle_btn_section', 615 'pages' => [ 'dtoc_sliding_sticky' ],570 'pages' => [ 'dtoc_sliding_sticky' ], 616 571 ], 617 572 'dtoc_customization_toggle_btn_fg_color' => [ … … 661 616 'callback' => 'dtoc_customization_icon_bg_color_cb', 662 617 'section' => 'dtoc_customization_icon_section', 663 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],618 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_shortcode' ], 664 619 ], 665 620 'dtoc_customization_icon_fg_color' => [ … … 667 622 'callback' => 'dtoc_customization_icon_fg_color_cb', 668 623 'section' => 'dtoc_customization_icon_section', 669 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],624 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_shortcode' ], 670 625 ], 671 626 'dtoc_customization_icon_size_color' => [ … … 673 628 'callback' => 'dtoc_customization_icon_size_cb', 674 629 'section' => 'dtoc_customization_icon_section', 675 'pages' => [ 'dtoc_incontent', 'dtoc_ shortcode' ],630 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_shortcode' ], 676 631 ], 677 632 'dtoc_customization_icon_border_type' => [ … … 679 634 'callback' => 'dtoc_customization_icon_border_type_cb', 680 635 'section' => 'dtoc_customization_icon_section', 681 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],636 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 682 637 ], 683 638 'dtoc_customization_icon_border_color' => [ … … 685 640 'callback' => 'dtoc_customization_icon_border_color_cb', 686 641 'section' => 'dtoc_customization_icon_section', 687 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],642 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 688 643 ], 689 644 'dtoc_customization_icon_border_width' => [ … … 691 646 'callback' => 'dtoc_customization_icon_border_width_cb', 692 647 'section' => 'dtoc_customization_icon_section', 693 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],648 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 694 649 ], 695 650 'dtoc_customization_icon_border_radius' => [ … … 697 652 'callback' => 'dtoc_customization_icon_border_radius_cb', 698 653 'section' => 'dtoc_customization_icon_section', 699 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],654 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 700 655 ], 701 656 'dtoc_customization_icon_padding' => [ … … 703 658 'callback' => 'dtoc_customization_icon_padding_cb', 704 659 'section' => 'dtoc_customization_icon_section', 705 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],660 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 706 661 ], 707 662 'dtoc_customization_icon_margin' => [ … … 709 664 'callback' => 'dtoc_customization_icon_margin_cb', 710 665 'section' => 'dtoc_customization_icon_section', 711 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],666 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 712 667 ], 713 668 … … 716 671 'callback' => 'dtoc_customization_bg_color_cb', 717 672 'section' => 'dtoc_customization_container_section', 718 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],673 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 719 674 ], 720 675 'dtoc_customization_link_color' => [ … … 722 677 'callback' => 'dtoc_customization_link_color_cb', 723 678 'section' => 'dtoc_customization_link_section', 724 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],679 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 725 680 ], 726 681 'dtoc_customization_link_hover_color' => [ … … 728 683 'callback' => 'dtoc_customization_link_hover_color_cb', 729 684 'section' => 'dtoc_customization_link_section', 730 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],685 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 731 686 ], 732 687 'dtoc_customization_link_visited_color' => [ … … 734 689 'callback' => 'dtoc_customization_link_visited_color_cb', 735 690 'section' => 'dtoc_customization_link_section', 736 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],691 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 737 692 ], 738 693 'dtoc_customization_link_padding' => [ … … 740 695 'callback' => 'dtoc_customization_link_padding_cb', 741 696 'section' => 'dtoc_customization_link_section', 742 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],697 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 743 698 ], 744 699 'dtoc_customization_link_margin' => [ … … 746 701 'callback' => 'dtoc_customization_link_margin_cb', 747 702 'section' => 'dtoc_customization_link_section', 748 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],703 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 749 704 ], 750 705 'dtoc_customization_container_width' => [ … … 752 707 'callback' => 'dtoc_customization_container_width_cb', 753 708 'section' => 'dtoc_customization_container_section', 754 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],709 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 755 710 ], 756 711 'dtoc_customization_container_height' => [ … … 758 713 'callback' => 'dtoc_customization_container_height_cb', 759 714 'section' => 'dtoc_customization_container_section', 760 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],715 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 761 716 ], 762 717 'dtoc_customization_container_margin' => [ … … 764 719 'callback' => 'dtoc_customization_container_margin_cb', 765 720 'section' => 'dtoc_customization_container_section', 766 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],721 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 767 722 ], 768 723 'dtoc_customization_container_padding' => [ … … 770 725 'callback' => 'dtoc_customization_container_padding_cb', 771 726 'section' => 'dtoc_customization_container_section', 772 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],727 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 773 728 ], 774 729 'dtoc_customization_border_type' => [ … … 776 731 'callback' => 'dtoc_customization_border_type_cb', 777 732 'section' => 'dtoc_customization_border_section', 778 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],733 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 779 734 ], 780 735 'dtoc_customization_border_color' => [ … … 782 737 'callback' => 'dtoc_customization_border_color_cb', 783 738 'section' => 'dtoc_customization_border_section', 784 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],739 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 785 740 ], 786 741 'dtoc_customization_border_width' => [ … … 788 743 'callback' => 'dtoc_customization_border_width_cb', 789 744 'section' => 'dtoc_customization_border_section', 790 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],745 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 791 746 ], 792 747 'dtoc_customization_border_radius' => [ … … 794 749 'callback' => 'dtoc_customization_border_radius_cb', 795 750 'section' => 'dtoc_customization_border_section', 796 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],751 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 797 752 ], 798 753 'dtoc_display_hierarchy' => [ … … 800 755 'callback' => 'dtoc_display_hierarchy_cb', 801 756 'section' => 'dtoc_advanced_setting_section', 802 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],757 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_shortcode' ], 803 758 'args' => [ 'label_for' => 'hierarchy' ], 804 759 ], … … 807 762 // 'callback' => 'dtoc_display_exp_col_subheadings_cb', 808 763 // 'section' => 'dtoc_advanced_setting_section', 809 // 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],764 // 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 810 765 // 'args' => [ 'label_for' => 'exp_col_subheadings', 'class' => 'dtoc_child_opt dtoc_hierarchy' ], 811 766 // ], … … 814 769 // 'callback' => 'dtoc_display_show_more_cb', 815 770 // 'section' => 'dtoc_advanced_setting_section', 816 // 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],771 // 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 817 772 // 'args' => [ 'label_for' => 'show_more' ], 818 773 // ], 819 //'dtoc_display_combine_page_break' => [820 //'title' => __( 'Combine Page Break', 'digital-table-of-contents' ),821 //'callback' => 'dtoc_display_combine_page_break_cb',822 //'section' => 'dtoc_advanced_setting_section',823 // 'pages' => [ 'dtoc_incontent', 'dtoc_sliding_sticky', 'dtoc_shortcode' ],824 //'args' => [ 'label_for' => 'combine_page_break' ],825 //],774 'dtoc_display_combine_page_break' => [ 775 'title' => __( 'Combine Page Break', 'digital-table-of-contents' ), 776 'callback' => 'dtoc_display_combine_page_break_cb', 777 'section' => 'dtoc_advanced_setting_section', 778 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 779 'args' => [ 'label_for' => 'combine_page_break' ], 780 ], 826 781 'dtoc_display_accessibility' => [ 827 782 'title' => __( 'Accessibility', 'digital-table-of-contents' ), 828 783 'callback' => 'dtoc_display_accessibility_cb', 829 784 'section' => 'dtoc_advanced_setting_section', 830 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],785 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 831 786 'args' => [ 'label_for' => 'accessibility' ], 832 787 ], … … 835 790 'callback' => 'dtoc_display_preserve_line_breaks_cb', 836 791 'section' => 'dtoc_advanced_setting_section', 837 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],792 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 838 793 'args' => [ 'label_for' => 'preserve_line_breaks' ], 839 794 ], … … 842 797 'callback' => 'dtoc_display_exclude_headings_cb', 843 798 'section' => 'dtoc_advanced_setting_section', 844 'pages' => [ 'dtoc_incontent', 'dtoc_ sliding_sticky', 'dtoc_shortcode' ],799 'pages' => [ 'dtoc_incontent', 'dtoc_incontent_mobile', 'dtoc_floating', 'dtoc_sliding_sticky', 'dtoc_sliding_sticky_mobile', 'dtoc_shortcode' ], 845 800 'args' => [ 'label_for' => 'exclude_headings' ], 846 801 ], … … 1833 1788 } 1834 1789 1790 public function dtoc_general_sticky_mobile_position_cb() { 1791 $this->dtoc_resolve_meta_settings_name(); 1792 ?> 1793 <select class="smpg-input" name="<?php echo esc_attr( $this->_setting_name ); ?>[display_position]" id="display_position"> 1794 <option value="bottom-sheet" <?php echo ( isset( $this->_setting_option['display_position'] ) && $this->_setting_option['display_position'] === 'bottom-sheet' ? 'selected' : '' ); ?>> 1795 <?php echo esc_html__( 'Bottom Sheet', 'digital-table-of-contents' ); ?> 1796 </option> 1797 <option value="top-sheet" <?php echo ( isset( $this->_setting_option['display_position'] ) && $this->_setting_option['display_position'] === 'top-sheet' ? 'selected' : '' ); ?>> 1798 <?php echo esc_html__( 'Top Sheet', 'digital-table-of-contents' ); ?> 1799 </option> 1800 </select> 1801 <?php 1802 } 1803 1835 1804 public function dtoc_general_paragraph_number_cb(){ 1836 1805 $this->dtoc_resolve_meta_settings_name(); -
digital-table-of-contents/trunk/admin/dashboard_page.php
r3361111 r3365361 115 115 ], 116 116 [ 117 'title' => ' Floating',118 'desc' => 'A Floating TOC is a movable, draggable, or collapsible navigation element that isn\'t fixed, allowing repositioning and enhanced interaction',119 'name' => ' floating',120 'url' => admin_url( 'admin.php?page=dtoc_ floating'),121 'learn' => 'https://digitaltableofcontents/documentation' 122 ], 117 'title' => 'Sliding Sticky Mobile', 118 'desc' => 'A sticky TOC that stays hidden and slides in from the Bottom to Topp or Top to Bottom when toggled. Best for users who want to save space and show TOC only when needed.', 119 'name' => 'sliding_sticky_mobile', 120 'url' => admin_url( 'admin.php?page=dtoc_sliding_sticky_mobile'), 121 'learn' => 'https://digitaltableofcontents/documentation' 122 ], 123 123 [ 124 124 'title' => 'In-Content Mobile', … … 129 129 ], 130 130 [ 131 'title' => 'In-Content Tablet', 132 'desc' => 'Enable for advanced, separate customization of the In-Content TOC in tablet. If disabled, the TOC will display by default based on the In-Content module.', 133 'name' => 'incontent_tablet', 134 'url' => admin_url( 'admin.php?page=dtoc_incontent_tablet'), 135 'learn' => 'https://digitaltableofcontents/documentation' 136 ], 137 [ 138 'title' => 'Sticky Mobile', 139 'desc' => 'Enable for advanced, separate customization of the Sticky TOC in mobile. If disabled, the TOC will display by default based on the Sticky module.', 140 'name' => 'sticky_mobile', 141 'url' => admin_url( 'admin.php?page=dtoc_sliding_sticky_mobile'), 142 'learn' => 'https://digitaltableofcontents/documentation' 143 ], 144 [ 145 'title' => 'Sticky Tablet', 146 'desc' => 'Enable for advanced, separate customization of the Sticky TOC in tablet. If disabled, the TOC will display by default based on the Sticky module.', 147 'name' => 'sticky_tablet', 148 'url' => admin_url( 'admin.php?page=dtoc_sliding_sticky_tablet'), 149 'learn' => 'https://digitaltableofcontents/documentation' 150 ], 151 [ 152 'title' => 'Floating Mobile', 153 'desc' => 'Enable for advanced, separate customization of the Floating TOC in mobile. If disabled, the TOC will display by default based on the floating module.', 154 'name' => 'floating_mobile', 155 'url' => admin_url( 'admin.php?page=dtoc_floating_mobile'), 156 'learn' => 'https://digitaltableofcontents/documentation' 157 ], 158 [ 159 'title' => 'Floating Tablet', 160 'desc' => 'Enable for advanced, separate customization of the Floating TOC in tablet. If disabled, the TOC will display by default based on the floating module.', 161 'name' => 'floating_tablet', 162 'url' => admin_url( 'admin.php?page=dtoc_floating_tablet'), 163 'learn' => 'https://digitaltableofcontents/documentation' 164 ], 165 [ 166 'title' => 'Shortcode Mobile', 167 'desc' => 'Enable for advanced, separate customization of the Shortcode in mobile. If disabled, the TOC will display by default based on the Shortcode module.', 168 'name' => 'shortcode_mobile', 169 'url' => admin_url( 'admin.php?page=dtoc_shortcode_mobile'), 170 'learn' => 'https://digitaltableofcontents/documentation' 171 ], 172 [ 173 'title' => 'Shortcode Tablet', 174 'desc' => 'Enable for advanced, separate customization of the Shortcode in tablet. If disabled, the TOC will display by default based on the Shortcode module.', 175 'name' => 'shortcode_tablet', 176 'url' => admin_url( 'admin.php?page=dtoc_shortcode_tablet'), 177 'learn' => 'https://digitaltableofcontents/documentation' 178 ] 131 'title' => 'Floating', 132 'desc' => 'A Floating TOC is a movable, draggable, or collapsible navigation element that isn\'t fixed, allowing repositioning and enhanced interaction', 133 'name' => 'floating', 134 'url' => admin_url( 'admin.php?page=dtoc_floating'), 135 'learn' => 'https://digitaltableofcontents/documentation' 136 ], 179 137 ]; 180 138 ?> … … 196 154 <div class="dtoc-loader"></div> 197 155 <label class="dtoc-switch"> 198 <input type="checkbox" class="dtoc-grid-checkbox" name="<?php echo esc_attr($value['name']) ?>" <?php if( $dtoc_dashboard['modules'][$value['name']] == true){ echo 'checked';}?> >156 <input type="checkbox" class="dtoc-grid-checkbox" name="<?php echo esc_attr($value['name']) ?>" <?php if( !empty( $dtoc_dashboard['modules'][$value['name']] ) ){ echo 'checked';}?> > 199 157 <span class="dtoc-slider"></span> 200 158 </label> -
digital-table-of-contents/trunk/admin/misc.php
r3361111 r3365361 23 23 $setting_name = str_replace( 'digital-toc_page_','',$screen_id ); 24 24 25 global $dtoc_dashboard, $dtoc_incontent, $dtoc_incontent_mobile, $dtoc_incontent_tablet, $dtoc_sliding_sticky, $dtoc_sliding_sticky_mobile, $dtoc_sliding_sticky_tablet, $dtoc_floating, $dtoc_floating_mobile, $dtoc_floating_tablet, $dtoc_shortcode, $dtoc_shortcode_mobile, $dtoc_shortcode_tablet;25 global $dtoc_dashboard, $dtoc_incontent, $dtoc_incontent_mobile, $dtoc_sliding_sticky, $dtoc_sliding_sticky_mobile, $dtoc_floating, $dtoc_shortcode; 26 26 27 27 $admin_data = []; … … 56 56 $reg_url = DTOC_URL . 'assets/admin/js/admin-incontent.js'; 57 57 break; 58 case 'dtoc_sliding_sticky': 58 case 'dtoc_sliding_sticky': 59 59 $admin_data['module_state'] = $dtoc_sliding_sticky; 60 $reg_url = DTOC_URL . 'assets/admin/js/admin-sticky.js'; 61 break; 62 case 'dtoc_sliding_sticky_mobile': 63 $admin_data['module_state'] = $dtoc_sliding_sticky_mobile; 60 64 $reg_url = DTOC_URL . 'assets/admin/js/admin-sticky.js'; 61 65 break; … … 64 68 $admin_data['module_default_state'] = dtoc_default_shortcode_options(); 65 69 $reg_url = DTOC_URL . 'assets/admin/js/admin-incontent.js'; 66 break; 70 break; 71 case 'dtoc_floating': 72 $admin_data['module_state'] = $dtoc_floating; 73 $reg_url = DTOC_URL . 'assets/admin/js/admin-floating.js'; 74 break; 75 case 'dtoc_incontent_mobile': 76 $admin_data['module_state'] = $dtoc_incontent_mobile; 77 $reg_url = DTOC_URL . 'assets/admin/js/admin-incontent.js'; 78 break; 67 79 # code... 68 80 break; … … 217 229 update_option('dtoc_sliding_sticky', $options['sliding_sticky']); 218 230 } 219 if (isset($options['s ticky_mobile'])) {220 update_option('dtoc_sliding_sticky_mobile', $options['s ticky_mobile']);231 if (isset($options['sliding_sticky_mobile'])) { 232 update_option('dtoc_sliding_sticky_mobile', $options['sliding_sticky_mobile']); 221 233 } 222 234 if (isset($options['sticky_tablet'])) { -
digital-table-of-contents/trunk/assets/admin/css/admin.css
r3361111 r3365361 487 487 } 488 488 489 490 /* Overlay for all .dtoc-grid-item except the first one */491 .dtoc-grid-container .dtoc-grid-item:not(:first-child):not(:nth-child(2)):not(:nth-child(3))::after {492 493 content: "Coming Soon";494 position: absolute;495 top: 0;496 left: 0;497 width: 100%;498 height: 100%;499 background: rgba(255,255,255,0.8);500 color: rgb(55, 156, 9);501 font-size: 16px;502 font-weight: bold;503 display: flex;504 justify-content: center;505 align-items: center;506 pointer-events: all;507 z-index: 9;508 text-transform: uppercase;509 border-radius: 6px;510 }511 512 .dtoc-grid-container .dtoc-grid-item:not(:first-child):not(:nth-child(2)):not(:nth-child(3)) {513 position: relative;514 pointer-events: none; /* Disable interaction */515 opacity: 0.6;516 }517 489 .dtoc-shortcode_source{ 518 490 padding: 10px; -
digital-table-of-contents/trunk/digital-table-of-contents.php
r3361202 r3365361 3 3 Plugin Name: Digital Table of Contents 4 4 Description: Show automated table of contents generated from the post content. 5 Version: 1.0. 3.15 Version: 1.0.4 6 6 Text Domain: digital-table-of-contents 7 7 Domain Path: /languages … … 14 14 if ( ! defined( 'ABSPATH' ) ) exit; 15 15 16 define('DTOC_VERSION', '1.0. 3.1');16 define('DTOC_VERSION', '1.0.4'); 17 17 define('DTOC_DIR_NAME', plugin_basename( dirname( __FILE__ ) ) ); 18 18 define('DTOC_BASE_NAME', plugin_basename( __FILE__ ) ); … … 37 37 require_once( DTOC_PATH . '/includes/misc.php' ); 38 38 require_once( DTOC_PATH . '/includes/generic_functions.php' ); 39 require_once( DTOC_PATH . '/includes/incontent/in_content.php' ); 39 require_once( DTOC_PATH . '/includes/incontent/in-content.php' ); 40 require_once( DTOC_PATH . '/includes/incontent/in-content-mobile.php' ); 41 require_once( DTOC_PATH . '/includes/shortcode/shortcode.php' ); 40 42 require_once( DTOC_PATH . '/includes/sticky/sliding-sticky.php' ); 43 require_once( DTOC_PATH . '/includes/sticky/sliding-sticky-mobile.php' ); 41 44 require_once( DTOC_PATH . '/includes/floating/floating.php' ); 42 require_once( DTOC_PATH . '/includes/shortcode/shortcode.php' ); -
digital-table-of-contents/trunk/includes/floating/floating.php
r3338299 r3365361 3 3 if ( ! defined( 'ABSPATH' ) ) exit; 4 4 5 add_filter( 'the_content', 'dtoc_floating_c ontent_callback');5 add_filter( 'the_content', 'dtoc_floating_callback' ); 6 6 7 function dtoc_floating_content_callback($content){ 7 function dtoc_floating_callback( $content ) { 8 9 global $dtoc_dashboard; 8 10 11 if ( empty( $dtoc_dashboard['modules']['floating'] ) ) { 12 return $content; 13 } 14 9 15 if ( is_singular() && in_the_loop() && is_main_query() ) { 10 16 11 global $dtoc_floating, $dtoc_dashboard; 17 $options = dtoc_get_options_by_device( 'floating' ); 18 19 if ( ! empty( $options ) && dtoc_placement_condition_matched( $options ) ) { 12 20 13 if(isset($dtoc_dashboard['modules']['floating']) && $dtoc_dashboard['modules']['floating'] == 1 && dtoc_placement_condition_matched($dtoc_floating)){ 14 $matches = dtoc_filter_heading($content,$dtoc_floating); 21 $matches = dtoc_filter_heading( $content, $options ); 15 22 16 if(!empty($matches)){ 17 $html = ''; 18 $headings = dtoc_get_headings($matches); 19 if(isset($dtoc_floating['jump_links']) && $dtoc_floating['jump_links'] == true){ 20 $anchors = dtoc_get_headings_with_anchors($matches); 21 $content = dtoc_add_jumb_ids( $headings, $anchors, $content ); 22 } 23 $html .= '<div class="dtoc-floating-container">'; 24 $html .= '<div class="dtoc-floating-body">'; 25 $html .= dtoc_get_plain_toc_html($matches , $dtoc_floating); 26 $html .= '</div>'; 27 $html .= '</div>'; 23 if ( ! empty( $matches ) ) { 28 24 29 $content = $content.$html; 30 } 25 $headings = dtoc_get_headings( $matches ); 26 27 if ( count( $headings ) ) { 28 29 if ( ! empty( $options['jump_links']) ) { 30 31 $anchors = dtoc_get_headings_with_anchors( $matches ); 32 $content = dtoc_add_jumb_ids( $headings, $anchors, $content ); 33 34 } 35 36 $content = $content.dtoc_floating_box( $matches, $options ); 37 38 } 39 40 } 31 41 } 32 42 … … 35 45 return $content; 36 46 } 47 48 function dtoc_floating_box( $matches, $options = [] ) { 49 50 $dbc_style = dtoc_box_container_style( $options ); 51 $html = '<div class="dtoc-floating-box-container" style="'.$dbc_style.'">'; 52 53 if ( ! empty( $options['display_title'] ) ) { 54 55 $heading_text = ''; 56 if ( isset( $options['header_text'] ) && $options['header_text'] === 'Table of Contents' ) { 57 $heading_text = '<span class="dtoc-floating-title-str">'.esc_html__( 'Table of Contents', 'digital-table-of-contents' ).'</span>'; 58 }else{ 59 $heading_text = '<span class="dtoc-floating-title-str">'.esc_html( $options['header_text'] ).'</span>'; 60 } 61 62 $t_style = dtoc_get_title_style( $options ); 63 $html .= '<div class="dtoc-floating-toggle-label" style="'.$t_style.'">'; 64 $html .= '<span class="dtoc-floating-left-grp">'; 65 $html .= '<span class="dtoc-floating-drag-icon" aria-hidden="true"></span>'; 66 $html .= $heading_text; 67 $html .= '</span>'; 68 $html .= dtoc_get_header_icon( $options ); 69 $html .= '</div>'; 70 } 71 $html .= dtoc_get_custom_style( $options ); 72 $html .= dtoc_get_toc_link_style( $options, 'incontent' ); 73 $html .= '<div class="dtoc-floating-box-body">'; 74 $html .= dtoc_get_plain_toc_html( $matches, $options ); 75 $html .= '</div>'; 76 77 $html .= '</div>'; 78 79 return $html; 80 } 81 82 add_filter('dtoc_regex_filter_incontent','dtoc_regex_heading_include_floating',10,1); 83 84 function dtoc_regex_heading_include_floating( $regex ) { 85 86 global $dtoc_dashboard, $dtoc_incontent, $dtoc_incontent_mobile, $dtoc_incontent_tablet; 87 $options = $dtoc_incontent; 88 $device_type = dtoc_get_device_type(); 89 90 switch ($device_type) { 91 92 case 'mobile': 93 $options = $dtoc_incontent_mobile; 94 break; 95 96 case 'tablet': 97 $options = $dtoc_incontent_tablet; 98 break; 99 100 default: 101 break; 102 103 } 104 if(!empty($options['headings_include'])) 105 { 106 $allowed_heading = array_keys($options['headings_include']); 107 $allowed_heading = is_array($allowed_heading)?implode(',',$allowed_heading):null; 108 109 if($allowed_heading){ 110 111 return '/(<h(['.esc_attr($allowed_heading).']{1})[^>]*>)(.*)<\/h\2>/msuU'; 112 } 113 } 114 return $regex; 115 } -
digital-table-of-contents/trunk/includes/generic_functions.php
r3361111 r3365361 2 2 // Exit if accessed directly. 3 3 if ( ! defined( 'ABSPATH' ) ) exit; 4 5 function dtoc_sliding_sticky_box_on_css( $matches , $options = [] ) {6 7 $dbc_style = dtoc_box_container_style( $options );8 9 // Handle toggle initial state10 $initial_state = ! empty( $options['toggle_initial'] ) ? $options['toggle_initial'] : 'hide';11 $checked_attr = ( $initial_state === 'show' ) ? ' checked="checked"' : '';12 13 // Add checkbox with conditional checked14 $html = '<input type="checkbox" id="dtoc-sliding-sticky-toggle"'. $checked_attr .'>' . "\n";15 16 $html .= '<div class="dtoc-sliding-sticky-container dtoc-'. esc_attr( $options['display_position'] ) .'" style="'.$dbc_style.'">' . "\n";17 18 $t_style = dtoc_get_toggle_btn_style( $options );19 $html .= '<label for="dtoc-sliding-sticky-toggle" class="dtoc-sliding-sticky-toggle-btn" style="'.$t_style.'">'. esc_html( $options['toggle_btn_text'] ) .'</label>' . "\n";20 21 // Scrollable inner wrapper22 $html .= '<div class="dtoc-sliding-sticky-inner">' . "\n";23 24 if ( ! empty( $options['display_title'] ) ) {25 $t_style = dtoc_get_title_style( $options );26 $html .= '<span class="dtoc-sliding-sticky-title-str" style="'.$t_style.'">'. esc_html( $options['header_text'] ) .'</span>' . "\n";27 }28 29 $html .= dtoc_get_custom_style( $options );30 $html .= dtoc_get_toc_link_style( $options, 'sliding_sticky' );31 32 $html .= '<div class="dtoc-sliding-sticky-box-body dtoc-sliding-sticky-box-on-css-body">' . "\n";33 $html .= dtoc_get_plain_toc_html( $matches, $options );34 $html .= '</div>' . "\n"; // close body35 36 $html .= '</div>' . "\n"; // close inner37 $html .= '</div>' . "\n"; // close container38 39 return $html;40 }41 42 43 function dtoc_sliding_sticky_box_on_js( $matches, $options = [] ) {44 45 $dbc_style = dtoc_box_container_style( $options );46 47 // Initial state (show/hide)48 $initial_state = ! empty( $options['toggle_initial'] ) ? $options['toggle_initial'] : 'hide';49 $initial_class = ( $initial_state === 'show' ) ? ' dtoc-open' : ' dtoc-closed';50 51 // Detect if left or right positioned52 $is_left = strpos( $options['display_position'], 'left' ) !== false;53 54 // Safe offset to avoid flicker (about 300px, adjust if needed)55 if ( $initial_state === 'show' ) {56 $dbc_style .= $is_left ? 'left:0;' : 'right:0;';57 } else {58 $dbc_style .= $is_left ? 'left:-300px;visibility:hidden;' : 'right:-300px;visibility:hidden;';59 }60 61 $html = '<div class="dtoc-sliding-sticky-container dtoc-' . esc_attr( $options['display_position'] ) . $initial_class . '" style="' . esc_attr( $dbc_style ) . '">' . "\n";62 63 // Toggle button64 $t_style = dtoc_get_toggle_btn_style( $options );65 $html .= '<button type="button" class="dtoc-sliding-sticky-toggle-btn" style="' . esc_attr( $t_style ) . '">' . esc_html( $options['toggle_btn_text'] ) . '</button>' . "\n";66 67 // Scrollable inner wrapper68 $html .= '<div class="dtoc-sliding-sticky-inner">' . "\n";69 70 if ( ! empty( $options['display_title'] ) ) {71 $t_style = dtoc_get_title_style( $options );72 $html .= '<span class="dtoc-sliding-sticky-title-str" style="' . esc_attr( $t_style ) . '">' . esc_html( $options['header_text'] ) . '</span>' . "\n";73 }74 75 $html .= dtoc_get_custom_style( $options );76 $html .= dtoc_get_toc_link_style( $options, 'sliding_sticky' );77 78 $html .= '<div class="dtoc-sliding-sticky-box-body dtoc-sliding-sticky-box-on-js-body">' . "\n";79 $html .= dtoc_get_plain_toc_html( $matches, $options );80 $html .= '</div>' . "\n"; // close body81 82 $html .= '</div>' . "\n"; // close inner83 $html .= '</div>' . "\n"; // close container84 85 return $html;86 }87 88 4 89 5 function dtoc_box_on_css( $matches , $options = [] ) { -
digital-table-of-contents/trunk/includes/misc.php
r3361202 r3365361 3 3 if ( ! defined( 'ABSPATH' ) ) exit; 4 4 5 add_action( 'wp_enqueue_scripts', 'dtoc_floating_modules_enqueue' ); 6 7 function dtoc_floating_modules_enqueue() { 8 9 global $dtoc_dashboard, $dtoc_floating; 10 11 if ( ! empty( $dtoc_dashboard['modules']['floating'] ) ) { 12 13 $data = []; 14 15 $data['scroll_behaviour'] = isset( $dtoc_floating['scroll_behavior'] ) ? $dtoc_floating['scroll_behavior'] : 'auto'; 16 $data['toggle_body'] = isset( $dtoc_floating['toggle_body'] ) ? 1 : 0; 17 18 $data = apply_filters( 'dtoc_localize_frontend_assets', $data, 'dtoc_localize_frontend_data' ); 19 20 wp_register_script( 'dtoc-floating-frontend', DTOC_URL . 'assets/frontend/js/dtoc_floating.js', array('jquery'), DTOC_VERSION , true ); 21 wp_localize_script( 'dtoc-floating-frontend', 'dtoc_localize_frontend_data', $data ); 22 wp_enqueue_script( 'dtoc-floating-frontend' ); 23 24 wp_enqueue_style( 'dtoc-floating-frontend', DTOC_URL . 'assets/frontend/css/dtoc-floating.css', false , DTOC_VERSION ); 25 26 $list_style_type = 'decimal'; 27 $counter_end = "'.'"; 28 if(!empty($dtoc_floating['list_style_type'])){ 29 $list_style_type = $dtoc_floating['list_style_type']; 30 if(in_array($list_style_type,array('circle','disc','square'))){ 31 $counter_end = ''; 32 } 33 34 } 35 $custom_css = ""; 36 $custom_css = " 37 .dtoc-floating-box-container ul{ 38 counter-reset: dtoc_item; 39 list-style-type: none; 40 } 41 .dtoc-floating-box-container ul li::before{ 42 counter-increment: dtoc_item; 43 content: counters(dtoc_item,'.', $list_style_type) $counter_end; 44 padding-right: 4px; 45 }"; 46 47 if ( isset( $dtoc_floating['display_title'] ) && isset( $dtoc_floating['toggle_body'] ) ) { 48 49 if ( $dtoc_floating['toggle_initial'] == 'hide' ) { 50 51 $custom_css .= ".dtoc-floating-box-body{ 52 display: none; 53 } 54 .dtoc-hide-text { 55 display: none; 56 } 57 "; 58 59 }else{ 60 61 $custom_css .= " 62 .dtoc-show-text { 63 display: none; 64 } 65 "; 66 } 67 68 $custom_css .= " 69 .dtoc-floating-toggle-label{ 70 cursor: pointer; 71 } 72 "; 73 74 75 } 76 77 if(isset($dtoc_floating['custom_css']) && !empty($dtoc_floating['custom_css'])){ 78 $custom_css .= $dtoc_floating['custom_css']; 79 } 80 wp_add_inline_style( 'dtoc-frontend', $custom_css ); 81 82 } 83 84 } 85 86 add_action( 'wp_enqueue_scripts', 'dtoc_sliding_sticky_mobile_modules_enqueue' ); 87 88 function dtoc_sliding_sticky_mobile_modules_enqueue() { 89 90 global $dtoc_dashboard, $dtoc_sliding_sticky_mobile; 91 92 if ( empty( $dtoc_dashboard['modules']['sliding_sticky_mobile'] ) ) { 93 return ''; 94 } 95 96 $data = []; 97 98 $data['scroll_behaviour'] = isset( $dtoc_sliding_sticky_mobile['scroll_behavior'] ) ? $dtoc_sliding_sticky_mobile['scroll_behavior'] : 'auto'; 99 $data['toggle_body'] = isset( $dtoc_sliding_sticky_mobile['toggle_body'] ) ? 1 : 0; 100 $data['display_position'] = $dtoc_sliding_sticky_mobile['display_position']; 101 102 wp_register_script( 'dtoc-sliding-sticky-mobile-frontend', DTOC_URL . 'assets/frontend/js/dtoc-sliding-sticky-mobile.js', array('jquery'), DTOC_VERSION , true ); 103 wp_localize_script( 'dtoc-sliding-sticky-mobile-frontend', 'dtoc_localize_frontend_sticky_data', $data ); 104 wp_enqueue_script( 'dtoc-sliding-sticky-mobile-frontend' ); 105 wp_enqueue_style( 'dtoc-sliding-sticky-mobile-frontend', DTOC_URL . 'assets/frontend/css/dtoc-sliding-sticky-mobile.css', false , DTOC_VERSION ); 106 107 $list_style_type = 'decimal'; 108 $counter_end = "'.'"; 109 110 if ( ! empty( $dtoc_sliding_sticky_mobile['list_style_type'] ) ) { 111 112 $list_style_type = $dtoc_sliding_sticky_mobile['list_style_type']; 113 114 if ( in_array( $list_style_type, array( 'circle','disc','square' ) ) ) { 115 $counter_end = ''; 116 } 117 118 } 119 $custom_css = ""; 120 $custom_css = " 121 .dtoc-sliding-sticky-mobile-container ul{ 122 counter-reset: dtoc_item; 123 list-style-type: none; 124 } 125 .dtoc-sliding-sticky-mobile-container ul li::before{ 126 counter-increment: dtoc_item; 127 content: counters(dtoc_item,'.', $list_style_type) $counter_end; 128 padding-right: 4px; 129 }"; 130 if ( isset( $dtoc_sliding_sticky_mobile['scroll_behavior'] ) && $dtoc_sliding_sticky_mobile['scroll_behavior'] == 'smooth' ) { 131 $custom_css .= "html { 132 scroll-behavior: smooth; 133 }"; 134 } 135 136 137 if(isset($dtoc_sliding_sticky_mobile['custom_css']) && !empty($dtoc_sliding_sticky_mobile['custom_css'])){ 138 $custom_css .= $dtoc_sliding_sticky_mobile['custom_css']; 139 } 140 wp_add_inline_style( 'dtoc-sliding-sticky-mobile-frontend', $custom_css ); 141 142 } 143 5 144 add_action( 'wp_enqueue_scripts', 'dtoc_sliding_sticky_modules_enqueue' ); 6 145 … … 25 164 wp_localize_script( 'dtoc-sliding-sticky-frontend', 'dtoc_localize_frontend_sticky_data', $data ); 26 165 wp_enqueue_script( 'dtoc-sliding-sticky-frontend' ); 27 wp_enqueue_style( 'dtoc-sliding-sticky-frontend', DTOC_URL . 'assets/frontend/css/dtoc-sliding-sticky- front-js-based.css', false , DTOC_VERSION );166 wp_enqueue_style( 'dtoc-sliding-sticky-frontend', DTOC_URL . 'assets/frontend/css/dtoc-sliding-sticky-js-based.css', false , DTOC_VERSION ); 28 167 29 168 }else{ 30 169 31 wp_enqueue_style( 'dtoc-sliding-sticky-frontend', DTOC_URL . 'assets/frontend/css/dtoc-sliding-sticky- front-css-based.css', false , DTOC_VERSION );170 wp_enqueue_style( 'dtoc-sliding-sticky-frontend', DTOC_URL . 'assets/frontend/css/dtoc-sliding-sticky-css-based.css', false , DTOC_VERSION ); 32 171 } 33 172 … … 77 216 global $dtoc_dashboard, $dtoc_incontent; 78 217 79 if ( !empty( $dtoc_dashboard['modules']['incontent'] ) || !empty( $dtoc_dashboard['modules'][' shortcode'] ) ) {218 if ( !empty( $dtoc_dashboard['modules']['incontent'] ) || !empty( $dtoc_dashboard['modules']['incontent_mobile'] ) || !empty( $dtoc_dashboard['modules']['shortcode'] ) ) { 80 219 81 220 $data = []; … … 88 227 $data = apply_filters( 'dtoc_localize_frontend_assets', $data, 'dtoc_localize_frontend_data' ); 89 228 90 wp_register_script( 'dtoc-frontend', DTOC_URL . 'assets/frontend/js/dtoc_ auto_place.js', array('jquery'), DTOC_VERSION , true );229 wp_register_script( 'dtoc-frontend', DTOC_URL . 'assets/frontend/js/dtoc_incontent.js', array('jquery'), DTOC_VERSION , true ); 91 230 wp_localize_script( 'dtoc-frontend', 'dtoc_localize_frontend_data', $data ); 92 231 wp_enqueue_script( 'dtoc-frontend' ); … … 94 233 } 95 234 96 wp_enqueue_style( 'dtoc-frontend', DTOC_URL . 'assets/frontend/css/dtoc- front.css', false , DTOC_VERSION );235 wp_enqueue_style( 'dtoc-frontend', DTOC_URL . 'assets/frontend/css/dtoc-incontent.css', false , DTOC_VERSION ); 97 236 98 237 $list_style_type = 'decimal'; -
digital-table-of-contents/trunk/includes/sticky/sliding-sticky.php
r3361111 r3365361 52 52 return $content; 53 53 } 54 55 function dtoc_sliding_sticky_box_on_css( $matches , $options = [] ) { 56 57 $dbc_style = dtoc_box_container_style( $options ); 58 59 // Handle toggle initial state 60 $initial_state = ! empty( $options['toggle_initial'] ) ? $options['toggle_initial'] : 'hide'; 61 $checked_attr = ( $initial_state === 'show' ) ? ' checked="checked"' : ''; 62 63 // Add checkbox with conditional checked 64 $html = '<input type="checkbox" id="dtoc-sliding-sticky-toggle"'. $checked_attr .'>' . "\n"; 65 66 $html .= '<div class="dtoc-sliding-sticky-container dtoc-'. esc_attr( $options['display_position'] ) .'" style="'.$dbc_style.'">' . "\n"; 67 68 $t_style = dtoc_get_toggle_btn_style( $options ); 69 $html .= '<label for="dtoc-sliding-sticky-toggle" class="dtoc-sliding-sticky-toggle-btn" style="'.$t_style.'">'. esc_html( $options['toggle_btn_text'] ) .'</label>' . "\n"; 70 71 // Scrollable inner wrapper 72 $html .= '<div class="dtoc-sliding-sticky-inner">' . "\n"; 73 74 if ( ! empty( $options['display_title'] ) ) { 75 $t_style = dtoc_get_title_style( $options ); 76 $html .= '<span class="dtoc-sliding-sticky-title-str" style="'.$t_style.'">'. esc_html( $options['header_text'] ) .'</span>' . "\n"; 77 } 78 79 $html .= dtoc_get_custom_style( $options ); 80 $html .= dtoc_get_toc_link_style( $options, 'sliding_sticky' ); 81 82 $html .= '<div class="dtoc-sliding-sticky-box-body dtoc-sliding-sticky-box-on-css-body">' . "\n"; 83 $html .= dtoc_get_plain_toc_html( $matches, $options ); 84 $html .= '</div>' . "\n"; // close body 85 86 $html .= '</div>' . "\n"; // close inner 87 $html .= '</div>' . "\n"; // close container 88 89 return $html; 90 } 91 92 93 function dtoc_sliding_sticky_box_on_js( $matches, $options = [] ) { 94 95 $dbc_style = dtoc_box_container_style( $options ); 96 97 // Initial state (show/hide) 98 $initial_state = ! empty( $options['toggle_initial'] ) ? $options['toggle_initial'] : 'hide'; 99 $initial_class = ( $initial_state === 'show' ) ? ' dtoc-open' : ' dtoc-closed'; 100 101 // Detect if left or right positioned 102 $is_left = strpos( $options['display_position'], 'left' ) !== false; 103 104 // Safe offset to avoid flicker (about 300px, adjust if needed) 105 if ( $initial_state === 'show' ) { 106 $dbc_style .= $is_left ? 'left:0;' : 'right:0;'; 107 } else { 108 $dbc_style .= $is_left ? 'left:-300px;visibility:hidden;' : 'right:-300px;visibility:hidden;'; 109 } 110 111 $html = '<div class="dtoc-sliding-sticky-container dtoc-' . esc_attr( $options['display_position'] ) . $initial_class . '" style="' . esc_attr( $dbc_style ) . '">' . "\n"; 112 113 // Toggle button 114 $t_style = dtoc_get_toggle_btn_style( $options ); 115 $html .= '<button type="button" class="dtoc-sliding-sticky-toggle-btn" style="' . esc_attr( $t_style ) . '">' . esc_html( $options['toggle_btn_text'] ) . '</button>' . "\n"; 116 117 // Scrollable inner wrapper 118 $html .= '<div class="dtoc-sliding-sticky-inner">' . "\n"; 119 120 if ( ! empty( $options['display_title'] ) ) { 121 $t_style = dtoc_get_title_style( $options ); 122 $html .= '<span class="dtoc-sliding-sticky-title-str" style="' . esc_attr( $t_style ) . '">' . esc_html( $options['header_text'] ) . '</span>' . "\n"; 123 } 124 125 $html .= dtoc_get_custom_style( $options ); 126 $html .= dtoc_get_toc_link_style( $options, 'sliding_sticky' ); 127 128 $html .= '<div class="dtoc-sliding-sticky-box-body dtoc-sliding-sticky-box-on-js-body">' . "\n"; 129 $html .= dtoc_get_plain_toc_html( $matches, $options ); 130 $html .= '</div>' . "\n"; // close body 131 132 $html .= '</div>' . "\n"; // close inner 133 $html .= '</div>' . "\n"; // close container 134 135 return $html; 136 } -
digital-table-of-contents/trunk/readme.txt
r3361202 r3365361 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 1.0. 3.18 Stable tag: 1.0.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 28 28 * <strong>Rendering Style </strong>: Choose between CSS-based (lightweight and fast with basic interactions) or JavaScript-based rendering (more interactive and dynamic behavior) depending on your performance and functionality needs. 29 29 * <strong>Multiple Header Icon Options</strong>: Choose from various icon styles like List Icon (☰), Show/Hide, Plus (+)/Minus (−), or even use a custom icon of your choice. 30 * <strong>Full Customization</strong>: No need to rely on predefined designs — easily customize colors, styles, icons, background , link colors, title, borders, and much more, all hassle-free.30 * <strong>Full Customization</strong>: No need to rely on predefined designs — easily customize colors, styles, icons, backgrounds, links, titles, borders, and much more. Hassle-free, giving you the freedom to create almost any type of table of contents design. 31 31 * <strong>Custom CSS</strong>: If the built-in customization options aren’t sufficient, you can add your own CSS directly in the provided Custom CSS box. 32 32 * <strong>Jump Links Control</strong>: Option to generate a TOC without clickable jump links, ideal for visual structure without navigation. 33 33 * <strong>Lightweight & Performance-Friendly</strong>: Built for speed and efficiency, the plugin is optimized to have minimal impact on your site’s load time and overall performance. 34 34 * <strong>Import / Export</strong>: Easily back up or transfer your TOC settings and configurations between sites with the one-click import/export feature. 35 * <strong>Delete Data on Uninstall</strong>: Option to remove all Digital Table of Contents plugin data from the database when Digital Table of Contents plugin is uninstalled, ensuring a clean removal.36 * <strong>Fast Help & Support</strong>: If you are unable to find any features related to Digital Table of Contents or found any bug. Please contact us, Digital Table of Contents team would try to solve it quickly.35 * <strong>Delete Plugin Data & Reset</strong>: Option to remove all Digital Table of Contents plugin data from the database when Digital Table of Contents plugin is uninstalled, ensuring a clean removal. 36 * <strong>Fast Help & Support</strong>: Facing issues or unable to find a feature in Digital Table of Contents? Our team is available 24/7 to assist you and resolve bugs or concerns as quickly as possible. 37 37 38 38 **Shortcode:** … … 47 47 48 48 49 **Available Modules (More Coming Soon!):**49 **Available Modules :** 50 50 51 - ✅ In-Content 52 - ✅ Shortcode 53 - ✅ Sliding Sticky 54 - 🔜 Sidebar Sticky 55 - 🔜 Floating TOC 56 - 🔜 In-Content (Mobile) 57 - 🔜 In-Content Table 58 - 🔜 Sticky (Mobile) 59 - 🔜 Sticky Table 60 - 🔜 Floating (Mobile) 61 - 🔜 Floating Table 51 - ✅ <strong>In-Content<strong> : Embed the table of contents directly within your post or page content for seamless navigation. 52 - ✅ <strong>In-Content Mobile<strong> : Optimized version of In-Content specifically designed for mobile devices. 53 - ✅ <strong>Shortcode<strong> : Easily insert the TOC anywhere using a simple shortcode, giving you full placement flexibility. 54 - ✅ <strong>Sliding Sticky<strong> : A sticky TOC that stays hidden and slides in from the left or right when toggled. Best for users who want to save space and show TOC only when needed. 55 - ✅ <strong>Sliding Sticky Mobile<strong> : A sticky TOC that stays hidden and slides in from the Bottom to Topp or Top to Bottom when toggled. Best for users who want to save space and show TOC only when needed. 56 - ✅ <strong>Floating<strong> : A Floating TOC is a movable, draggable, or collapsible navigation element that isn't fixed, allowing repositioning and enhanced interaction 62 57 63 58 == Screenshots == … … 110 105 == Changelog == 111 106 107 108 = 1.0.4 = 109 * Sliding Sticky Mobile module added. 110 * Incontent Mobile module added. 111 * Floating module added. 112 112 113 = 1.0.3.1 = 113 114 * Fixed Incontent toc is broken -
digital-table-of-contents/trunk/shared/functions.php
r3361111 r3365361 7 7 function dtoc_options_init(){ 8 8 9 global $dtoc_dashboard, $dtoc_incontent, $dtoc_incontent_mobile, $dtoc_ incontent_tablet, $dtoc_sliding_sticky, $dtoc_sliding_sticky_mobile, $dtoc_sliding_sticky_tablet, $dtoc_floating, $dtoc_floating_mobile, $dtoc_floating_tablet, $dtoc_shortcode, $dtoc_shortcode_mobile, $dtoc_shortcode_tablet, $dtoc_compatibility;9 global $dtoc_dashboard, $dtoc_incontent, $dtoc_incontent_mobile, $dtoc_sliding_sticky, $dtoc_sliding_sticky_mobile, $dtoc_floating, $dtoc_shortcode, $dtoc_compatibility; 10 10 11 11 $dtoc_dashboard = get_option( 'dtoc_dashboard', dtoc_default_dashboard_options() ); 12 12 13 13 $dtoc_incontent = get_option( 'dtoc_incontent', dtoc_default_incontent_options() ); 14 $dtoc_incontent_mobile = get_option( 'dtoc_incontent_mobile', dtoc_default_incontent_mobile_options() ); 15 $dtoc_incontent_tablet = get_option( 'dtoc_incontent_tablet', dtoc_default_incontent_tablet_options() ); 16 17 $dtoc_shortcode = get_option( 'dtoc_shortcode', dtoc_default_shortcode_options() ); 18 $dtoc_shortcode_mobile = get_option( 'dtoc_shortcode_mobile', dtoc_default_shortcode_mobile_options() ); 19 $dtoc_shortcode_tablet = get_option( 'dtoc_shortcode_tablet', dtoc_default_shortcode_tablet_options() ); 14 $dtoc_incontent_mobile = get_option( 'dtoc_incontent_mobile', dtoc_default_incontent_mobile_options() ); 15 16 $dtoc_shortcode = get_option( 'dtoc_shortcode', dtoc_default_shortcode_options() ); 20 17 21 18 $dtoc_sliding_sticky = get_option( 'dtoc_sliding_sticky', dtoc_default_sticky_options() ); 22 $dtoc_sliding_sticky_mobile = get_option( 'dtoc_sliding_sticky_mobile', dtoc_default_sticky_mobile_options() ); 23 $dtoc_sliding_sticky_tablet = get_option( 'dtoc_sliding_sticky_tablet', dtoc_default_sticky_tablet_options() ); 24 25 $dtoc_floating = get_option( 'dtoc_floating', dtoc_default_floating_options() ); 26 $dtoc_floating_mobile = get_option( 'dtoc_floating_mobile', dtoc_default_floating_mobile_options() ); 27 $dtoc_floating_tablet = get_option( 'dtoc_floating_tablet', dtoc_default_floating_tablet_options() ); 19 $dtoc_sliding_sticky_mobile = get_option( 'dtoc_sliding_sticky_mobile', dtoc_default_sticky_mobile_options() ); 20 21 $dtoc_floating = get_option( 'dtoc_floating', dtoc_default_floating_options() ); 28 22 29 23 $dtoc_compatibility = get_option( 'dtoc_compatibility', dtoc_default_compatibility_options() ); … … 32 26 function dtoc_default_floating_options(){ 33 27 34 $default = dtoc_option_types('all',['floating'],'default'); 35 $default = apply_filters("dtoc_default_floating_options_filter", $default); 36 return $default; 37 } 38 function dtoc_default_floating_mobile_options(){ 39 $default = dtoc_option_types('all',['floating_mobile'],'default'); 40 $default = apply_filters("dtoc_default_floating_mobile_options_filter", $default); 41 return $default; 42 } 43 function dtoc_default_floating_tablet_options(){ 44 $default = dtoc_option_types('all',['floating_tablet'],'default'); 45 $default = apply_filters("dtoc_default_floating_tablet_options_filter", $default); 28 $default = [ 29 "rendering_style" => "js", 30 "display_title" => 1, 31 "header_text" => "Table of Contents", 32 "toggle_body" => 1, 33 "toggle_initial" => "show", 34 "header_icon" => "list_icon", 35 "custom_icon_url" => "", 36 "show_text" => "show", 37 "hide_text" => "hide", 38 "jump_links" => 1, 39 "scroll_behavior" => "smooth", 40 "alignment" => "left", 41 "display_when" => 2, 42 "display_position" => "top_of_the_content", 43 "paragraph_number" => 1, 44 "list_style_type" => "decimal", 45 "headings_include" => [ 46 "1" => 1, 47 "2" => 1, 48 "3" => 1, 49 "4" => 1, 50 "5" => 1, 51 "6" => 1, 52 ], 53 "hierarchy" => 0, 54 "combine_page_break" => 0, 55 "accessibility" => 1, 56 "preserve_line_breaks" => 0, 57 "exclude_headings" => '', 58 "placement" => [ 59 "post" => [ 60 "is_enabled" => 1, 61 "taxonomy" => [ 62 "post_tag" => [ 63 "ope" => "OR", 64 ], 65 ], 66 ], 67 ], 68 "bg_color" => "#f9f9f9", 69 "container_width_mode" => "default", 70 "container_width" => 0, 71 "container_width_unit" => "px", 72 "container_height_mode" => "default", 73 "design_type" => "px", 74 "container_margin_mode" => "default", 75 "container_margin_top" => 0, 76 "container_margin_right" => 0, 77 "container_margin_bottom" => 0, 78 "container_margin_left" => 0, 79 "container_margin_unit" => "px", 80 "container_padding_mode" => "default", 81 "container_padding_top" => 0, 82 "container_padding_right" => 0, 83 "container_padding_bottom" => 0, 84 "container_padding_left" => 0, 85 "container_padding_unit" => "px", 86 "border_type" => "solid", 87 "border_color" => "#dddddd", 88 "border_width_mode" => "custom", 89 "border_width_top" => 1, 90 "border_width_right" => 1, 91 "border_width_bottom" => 1, 92 "border_width_left" => 1, 93 "border_width_unit" => "px", 94 "border_radius_mode" => "default", 95 "border_radius_top_left" => 0, 96 "border_radius_top_right" => 0, 97 "border_radius_bottom_left" => 0, 98 "border_radius_bottom_right" => 0, 99 "border_radius_unit" => "px", 100 "title_bg_color" => "#eeeeee", 101 "title_fg_color" => "#222222", 102 "title_font_size_mode" => "default", 103 "title_font_size" => 0, 104 "title_font_size_unit" => "px", 105 "title_font_weight_mode" => "default", 106 "title_font_weight" => 0, 107 "title_padding_mode" => "default", 108 "title_padding_top" => 0, 109 "title_padding_right" => 0, 110 "title_padding_bottom" => 0, 111 "title_padding_left" => 0, 112 "title_padding_unit" => "px", 113 "icon_bg_color" => "#e0e0e0", 114 "icon_fg_color" => "#333333", 115 "icon_size_mode" => "default", 116 "icon_width" => 25, 117 "icon_height" => 25, 118 "icon_size_unit" => "px", 119 "icon_border_type" => "default", 120 "icon_border_color" => "#D5E0EB", 121 "icon_border_width_mode" => "default", 122 "icon_border_width_top" => 0, 123 "icon_border_width_right" => 0, 124 "icon_border_width_bottom" => 0, 125 "icon_border_width_left" => 0, 126 "icon_border_width_unit" => "px", 127 "icon_border_radius_mode" => "default", 128 "icon_border_radius_top_left" => 0, 129 "icon_border_radius_top_right" => 0, 130 "icon_border_radius_bottom_left" => 0, 131 "icon_border_radius_bottom_right" => 0, 132 "icon_border_radius_unit" => "px", 133 "icon_padding_mode" => "default", 134 "icon_padding_top" => 0, 135 "icon_padding_right" => 0, 136 "icon_padding_bottom" => 0, 137 "icon_padding_left" => 0, 138 "icon_padding_unit" => "px", 139 "icon_margin_mode" => "default", 140 "icon_margin_top" => 0, 141 "icon_margin_right" => 0, 142 "icon_margin_bottom" => 0, 143 "icon_margin_left" => 0, 144 "icon_margin_unit" => "px", 145 "link_color" => "#1a73e8", 146 "link_hover_color" => "#0c47a1", 147 "link_visited_color" => "#5f6368", 148 "link_padding_mode" => "default", 149 "link_padding_top" => 0, 150 "link_padding_right" => 0, 151 "link_padding_bottom" => 0, 152 "link_padding_left" => 0, 153 "link_padding_unit" => "px", 154 "link_margin_mode" => "default", 155 "link_margin_top" => 0, 156 "link_margin_right" => 0, 157 "link_margin_bottom" => 0, 158 "link_margin_left" => 0, 159 "link_margin_unit" => "px", 160 "custom_css" => "", 161 ]; 162 163 $default = apply_filters("dtoc_default_incontent_options_filter", $default); 46 164 return $default; 47 165 } … … 167 285 } 168 286 function dtoc_default_sticky_mobile_options(){ 169 $default = dtoc_option_types('all',['sticky_mobile'],'default'); 170 $default = apply_filters("dtoc_default_sticky_mobile_options_filter", $default); 171 return $default; 172 } 173 function dtoc_default_sticky_tablet_options(){ 174 $default = dtoc_option_types('all',['sticky_tablet'],'default'); 175 $default = apply_filters("dtoc_default_sticky_tablet_options_filter", $default); 176 return $default; 287 $default = [ 288 "header_text" => "Table of Contents", 289 "toggle_initial" => "hide", 290 "jump_links" => 1, 291 "scroll_behavior" => "smooth", 292 "display_when" => 2, 293 "display_position" => "bottom-sheet", 294 "list_style_type" => "decimal", 295 "headings_include" => [ 296 "1" => 1, 297 "2" => 1, 298 "3" => 1, 299 "4" => 1, 300 "5" => 1, 301 "6" => 1, 302 ], 303 "accessibility" => 1, 304 "exclude_headings" => "", 305 "placement" => [ 306 "post" => [ 307 "is_enabled" => 1, 308 ], 309 ], 310 "bg_color" => "#f9f9f9", 311 "container_width_mode" => "default", 312 "container_width" => 0, 313 "container_width_unit" => "px", 314 "container_height_mode" => "default", 315 "design_type" => "px", 316 "container_margin_mode" => "default", 317 "container_margin_top" => 0, 318 "container_margin_right" => 0, 319 "container_margin_bottom" => 0, 320 "container_margin_left" => 0, 321 "container_margin_unit" => "px", 322 "container_padding_mode" => "default", 323 "container_padding_top" => 0, 324 "container_padding_right" => 0, 325 "container_padding_bottom" => 0, 326 "container_padding_left" => 0, 327 "container_padding_unit" => "px", 328 "border_type" => "solid", 329 "border_color" => "#dddddd", 330 "border_width_mode" => "custom", 331 "border_width_top" => 1, 332 "border_width_right" => 1, 333 "border_width_bottom" => 1, 334 "border_width_left" => 1, 335 "border_width_unit" => "px", 336 "border_radius_mode" => "default", 337 "border_radius_top_left" => 0, 338 "border_radius_top_right" => 0, 339 "border_radius_bottom_left" => 0, 340 "border_radius_bottom_right" => 0, 341 "border_radius_unit" => "px", 342 "title_bg_color" => "#f9f9f9", 343 "title_fg_color" => "#222222", 344 "title_font_size_mode" => "default", 345 "title_font_size" => 0, 346 "title_font_size_unit" => "px", 347 "title_font_weight_mode" => "default", 348 "title_font_weight" => 0, 349 "title_padding_mode" => "default", 350 "title_padding_top" => 0, 351 "title_padding_right" => 0, 352 "title_padding_bottom" => 0, 353 "title_padding_left" => 0, 354 "title_padding_unit" => "px", 355 "toggle_btn_bg_color" => "#d3d3d3", 356 "toggle_btn_fg_color" => "#000000", 357 "toggle_btn_size_mode" => "default", 358 "toggle_btn_width" => 25, 359 "toggle_btn_height" => 25, 360 "toggle_btn_size_unit" => "px", 361 "toggle_btn_border_type" => "default", 362 "toggle_btn_border_color" => "#d3d3d3", 363 "toggle_btn_border_width_mode" => "default", 364 "toggle_btn_border_width_top" => 0, 365 "toggle_btn_border_width_right" => 0, 366 "toggle_btn_border_width_bottom" => 0, 367 "toggle_btn_border_width_left" => 0, 368 "toggle_btn_border_width_unit" => "px", 369 "toggle_btn_border_radius_mode" => "default", 370 "toggle_btn_border_radius_top_left" => 0, 371 "toggle_btn_border_radius_top_right" => 0, 372 "toggle_btn_border_radius_bottom_left" => 0, 373 "toggle_btn_border_radius_bottom_right" => 0, 374 "toggle_btn_border_radius_unit" => "px", 375 "toggle_btn_padding_mode" => "default", 376 "toggle_btn_padding_top" => 0, 377 "toggle_btn_padding_right" => 0, 378 "toggle_btn_padding_bottom" => 0, 379 "toggle_btn_padding_left" => 0, 380 "toggle_btn_padding_unit" => "px", 381 "link_color" => "#1a73e8", 382 "link_hover_color" => "#0c47a1", 383 "link_visited_color" => "#465568", 384 "link_padding_mode" => "default", 385 "link_padding_top" => 0, 386 "link_padding_right" => 0, 387 "link_padding_bottom" => 0, 388 "link_padding_left" => 0, 389 "link_padding_unit" => "px", 390 "link_margin_mode" => "default", 391 "link_margin_top" => 0, 392 "link_margin_right" => 0, 393 "link_margin_bottom" => 0, 394 "link_margin_left" => 0, 395 "link_margin_unit" => "px", 396 "custom_css" => "", 397 ]; 398 399 $default = apply_filters("dtoc_default_sticky_mobile_options_filter", $default ); 400 return $default; 177 401 } 178 402 function dtoc_default_incontent_options(){ … … 317 541 } 318 542 function dtoc_default_incontent_mobile_options(){ 319 $default = dtoc_option_types('all',['incontent_mobile'],'default'); 320 $default = apply_filters("dtoc_default_incontent_mobile_options_filter", $default); 321 return $default; 322 } 323 function dtoc_default_incontent_tablet_options(){ 324 $default = dtoc_option_types('all',['incontent_tablet'],'default'); 325 $default = apply_filters("dtoc_default_incontent_tablet_options_filter", $default); 543 $default = [ 544 "rendering_style" => "js", 545 "display_title" => 1, 546 "header_text" => "Table of Contents", 547 "toggle_body" => 1, 548 "toggle_initial" => "show", 549 "header_icon" => "list_icon", 550 "custom_icon_url" => "", 551 "show_text" => "show", 552 "hide_text" => "hide", 553 "jump_links" => 1, 554 "scroll_behavior" => "smooth", 555 "alignment" => "left", 556 "display_when" => 2, 557 "display_position" => "top_of_the_content", 558 "paragraph_number" => 1, 559 "list_style_type" => "decimal", 560 "headings_include" => [ 561 "1" => 1, 562 "2" => 1, 563 "3" => 1, 564 "4" => 1, 565 "5" => 1, 566 "6" => 1, 567 ], 568 "hierarchy" => 0, 569 "combine_page_break" => 0, 570 "accessibility" => 1, 571 "preserve_line_breaks" => 0, 572 "exclude_headings" => '', 573 "placement" => [ 574 "post" => [ 575 "is_enabled" => 1, 576 "taxonomy" => [ 577 "post_tag" => [ 578 "ope" => "OR", 579 ], 580 ], 581 ], 582 ], 583 "bg_color" => "#f9f9f9", 584 "container_width_mode" => "default", 585 "container_width" => 0, 586 "container_width_unit" => "px", 587 "container_height_mode" => "default", 588 "design_type" => "px", 589 "container_margin_mode" => "default", 590 "container_margin_top" => 0, 591 "container_margin_right" => 0, 592 "container_margin_bottom" => 0, 593 "container_margin_left" => 0, 594 "container_margin_unit" => "px", 595 "container_padding_mode" => "default", 596 "container_padding_top" => 0, 597 "container_padding_right" => 0, 598 "container_padding_bottom" => 0, 599 "container_padding_left" => 0, 600 "container_padding_unit" => "px", 601 "border_type" => "solid", 602 "border_color" => "#dddddd", 603 "border_width_mode" => "custom", 604 "border_width_top" => 1, 605 "border_width_right" => 1, 606 "border_width_bottom" => 1, 607 "border_width_left" => 1, 608 "border_width_unit" => "px", 609 "border_radius_mode" => "default", 610 "border_radius_top_left" => 0, 611 "border_radius_top_right" => 0, 612 "border_radius_bottom_left" => 0, 613 "border_radius_bottom_right" => 0, 614 "border_radius_unit" => "px", 615 "title_bg_color" => "#eeeeee", 616 "title_fg_color" => "#222222", 617 "title_font_size_mode" => "default", 618 "title_font_size" => 0, 619 "title_font_size_unit" => "px", 620 "title_font_weight_mode" => "default", 621 "title_font_weight" => 0, 622 "title_padding_mode" => "default", 623 "title_padding_top" => 0, 624 "title_padding_right" => 0, 625 "title_padding_bottom" => 0, 626 "title_padding_left" => 0, 627 "title_padding_unit" => "px", 628 "icon_bg_color" => "#e0e0e0", 629 "icon_fg_color" => "#333333", 630 "icon_size_mode" => "default", 631 "icon_width" => 25, 632 "icon_height" => 25, 633 "icon_size_unit" => "px", 634 "icon_border_type" => "default", 635 "icon_border_color" => "#D5E0EB", 636 "icon_border_width_mode" => "default", 637 "icon_border_width_top" => 0, 638 "icon_border_width_right" => 0, 639 "icon_border_width_bottom" => 0, 640 "icon_border_width_left" => 0, 641 "icon_border_width_unit" => "px", 642 "icon_border_radius_mode" => "default", 643 "icon_border_radius_top_left" => 0, 644 "icon_border_radius_top_right" => 0, 645 "icon_border_radius_bottom_left" => 0, 646 "icon_border_radius_bottom_right" => 0, 647 "icon_border_radius_unit" => "px", 648 "icon_padding_mode" => "default", 649 "icon_padding_top" => 0, 650 "icon_padding_right" => 0, 651 "icon_padding_bottom" => 0, 652 "icon_padding_left" => 0, 653 "icon_padding_unit" => "px", 654 "icon_margin_mode" => "default", 655 "icon_margin_top" => 0, 656 "icon_margin_right" => 0, 657 "icon_margin_bottom" => 0, 658 "icon_margin_left" => 0, 659 "icon_margin_unit" => "px", 660 "link_color" => "#1a73e8", 661 "link_hover_color" => "#0c47a1", 662 "link_visited_color" => "#5f6368", 663 "link_padding_mode" => "default", 664 "link_padding_top" => 0, 665 "link_padding_right" => 0, 666 "link_padding_bottom" => 0, 667 "link_padding_left" => 0, 668 "link_padding_unit" => "px", 669 "link_margin_mode" => "default", 670 "link_margin_top" => 0, 671 "link_margin_right" => 0, 672 "link_margin_bottom" => 0, 673 "link_margin_left" => 0, 674 "link_margin_unit" => "px", 675 "custom_css" => "", 676 ]; 677 678 $default = apply_filters("dtoc_default_incontent_options_filter", $default); 326 679 return $default; 327 680 } … … 343 696 344 697 $default = [ 345 'delete_plugin_data' => false,698 'delete_plugin_data' => false, 346 699 'modules' => [ 347 'incontent' => true, 348 'incontent_mobile' => false, 349 'incontent_tablet' => false, 350 'sliding_sticky' => false, 351 'sticky_mobile' => false, 352 'sticky_tablet' => false, 353 'floating' => false, 354 'floating_mobile' => false, 355 'floating_tablet' => false, 356 'shortcode' => false, 357 'shortcode_mobile' => false, 358 'shortcode_tablet' => false, 700 'incontent' => true, 701 'incontent_mobile' => false, 702 'sliding_sticky' => false, 703 'sliding_sticky_mobile' => false, 704 'floating' => false, 705 'shortcode' => false 359 706 ] 360 707 ]; … … 496 843 } 497 844 498 function dtoc_default_shortcode_mobile_options(){499 $default = dtoc_option_types('all',['shortcode_mobile'],'default');500 $default = apply_filters("dtoc_default_shortcode_mobile_options_filter", $default);501 return $default;502 }503 function dtoc_default_shortcode_tablet_options(){504 $default = dtoc_option_types('all',['shortcode_tablet'],'default');505 $default = apply_filters("dtoc_default_shortcode_tablet_options_filter", $default);506 return $default;507 }508 845 function dtoc_allowed_html_tags() { 509 846 -
digital-table-of-contents/trunk/uninstall.php
r3338299 r3365361 1 1 <?php 2 // exit if accessed directly 3 if (!defined('WP_UNINSTALL_PLUGIN')) { 4 die; 2 /** 3 * Uninstall script for Digital TOC Plugin. 4 * 5 * Fired when the plugin is deleted from WordPress. 6 * 7 * @package DigitalTOC 8 */ 9 10 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 11 exit; 5 12 } 6 13 7 echo 'comming soon'; 14 /** 15 * Delete plugin options (site-level + network-level). 16 */ 17 function dtoc_delete_plugin_data() { 18 19 $dtoc_dashboard = get_option( 'dtoc_dashboard' , false ); 20 21 if ( empty( $dtoc_dashboard['delete_plugin_data'] ) ) { 22 // User did not enable data removal → exit without deleting. 23 return; 24 } 25 26 // List of site-level options. 27 $site_options = [ 28 'dtoc_dashboard', 29 'dtoc_incontent', 30 'dtoc_incontent_mobile', 31 'dtoc_shortcode', 32 'dtoc_sliding_sticky', 33 'dtoc_sliding_sticky_mobile', 34 'dtoc_floating', 35 'dtoc_compatibility', 36 ]; 37 38 if ( ! is_multisite() ) { 39 // Single site cleanup. 40 foreach ( $site_options as $option ) { 41 delete_option( $option ); 42 } 43 } else { 44 // Multisite: loop through all sites. 45 $sites = get_sites( [ 'fields' => 'ids' ] ); 46 47 foreach ( $sites as $site_id ) { 48 switch_to_blog( $site_id ); 49 50 foreach ( $site_options as $option ) { 51 delete_option( $option ); 52 } 53 54 restore_current_blog(); 55 } 56 } 57 } 58 59 dtoc_delete_plugin_data();
Note: See TracChangeset
for help on using the changeset viewer.