Changeset 1738641
- Timestamp:
- 09/29/2017 09:55:12 PM (8 years ago)
- Location:
- bkc-wp-shortcodes/trunk
- Files:
-
- 4 edited
- bkc-wp-shortcodes.php (modified) (1 diff)
- classes/class-bkc-wp-shortcodes-loader.php (modified) (1 diff)
- classes/class-bkc-wp-shortcodes.php (modified) (5 diffs)
- readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bkc-wp-shortcodes/trunk/bkc-wp-shortcodes.php
r1736512 r1738641 3 3 * Plugin Name: Shortcodes 4 4 * Description: This Plugin provides multiple wordpress core shortcodes. 5 * Version: 1.0. 05 * Version: 1.0.1 6 6 * Author: Dinesh Chouhan 7 7 * Author URI: http://dineshchouhan.com -
bkc-wp-shortcodes/trunk/classes/class-bkc-wp-shortcodes-loader.php
r1736512 r1738641 55 55 public function __construct() { 56 56 57 define( 'BKC_WP_SHORTCODES_VER', '1.0. 0' );57 define( 'BKC_WP_SHORTCODES_VER', '1.0.1' ); 58 58 define( 'BKC_WP_SHORTCODES_FILE', trailingslashit( dirname( dirname( __FILE__ ) ) ) . 'bkc-wp-shortcodes.php' ); 59 59 define( 'BKC_WP_SHORTCODES_BASE', plugin_basename( BKC_WP_SHORTCODES_FILE ) ); -
bkc-wp-shortcodes/trunk/classes/class-bkc-wp-shortcodes.php
r1736512 r1738641 70 70 71 71 add_shortcode( 'wp_get_option', array( $this, 'get_option' ) ); 72 add_shortcode( 'wp_get_network_option', array( $this, 'get_network_option' ) ); 72 73 add_shortcode( 'wp_get_post_meta', array( $this, 'get_post_meta' ) ); 73 74 add_shortcode( 'wp_get_metadata', array( $this, 'get_metadata' ) ); … … 116 117 'author_nicename' => '', 117 118 ), 119 'wp_get_attachment_link' => array( 120 'post' => null, 121 'leavename' => false, 122 ), 123 'wp_get_users' => array( 124 'args' => array(), 125 ), 126 'wp_get_avatar' => array( 127 'id_or_email' => '', 128 'size' => 96, 129 'default' => '', 130 'alt' => '', 131 'args' => null, 132 ), 133 'wp_get_avatar_url' => array( 134 'id_or_email' => '', 135 'args' => null, 136 ), 137 'wp_get_blogaddress_by_id' => array( 138 'blog_id' => 0, 139 ), 140 'wp_get_blogaddress_by_name' => array( 141 'blogname' => '', 142 ), 143 'wp_get_blog_count' => array( 144 'network_id' => null, 145 ), 146 'wp_get_blog_id_from_url' => array( 147 'domain' => '', 148 'path ' => '/', 149 ), 150 'wp_get_sites' => array( 151 'args' => array(), 152 ), 153 'wp_get_blog_option' => array( 154 'id' => 0, 155 'option' => '', 156 'default' => false, 157 ), 158 'wp_get_blog_permalink' => array( 159 'blog_id' => 0, 160 'post_id' => 0, 161 ), 162 'wp_get_calendar' => array( 163 'initial' => true, 164 'echo' => true, 165 ), 166 'wp_get_category_link' => array( 167 'category' => 0, 168 ), 169 'wp_get_cat_name' => array( 170 'cat_id' => 0, 171 ), 172 'wp_get_cat_ID' => array( 173 'cat_name' => '', 174 ), 175 'wp_get_comments_link' => array( 176 'post_id' => 0, 177 ), 178 'wp_get_comments_number' => array( 179 'post_id' => 0, 180 ), 181 'wp_get_comments_number_text' => array( 182 'zero' => false, 183 'one' => false, 184 'more' => false, 185 ), 186 'wp_get_comments_pagenum_link' => array( 187 'pagenum' => 1, 188 'max_page' => '', 189 ), 190 'wp_get_comment_author' => array( 191 'comment_ID' => 0, 192 ), 193 'wp_get_comment_author_link' => array( 194 'comment_ID' => 0, 195 ), 196 'wp_get_comment_author_url' => array( 197 'comment_ID' => 0, 198 ), 199 'wp_get_comment_author_url_link' => array( 200 'linktext' => '', 201 'before' => '', 202 'after' => '', 203 'comment' => null, 204 ), 205 'wp_get_comment_author_email' => array( 206 'comment_ID' => 0, 207 ), 208 'wp_get_comment_author_email_link' => array( 209 'linktext' => '', 210 'before' => '', 211 'after' => '', 212 'comment' => null, 213 ), 214 'wp_get_comment_author_IP' => array( 215 'comment_ID' => 0, 216 ), 217 'wp_get_comment_excerpt' => array( 218 'comment_ID' => 0, 219 ), 220 'wp_get_comment_guid' => array( 221 'comment_ID' => 0, 222 ), 223 'wp_get_comment_date' => array( 224 'd' => '', 225 'comment_ID' => 0, 226 ), 227 'wp_get_comment_id_fields' => array( 228 'id' => 0, 229 ), 230 'wp_get_comment_link' => array( 231 'comment' => null, 232 'args' => array(), 233 ), 234 'wp_get_comment_pages_count' => array( 235 'comments' => null, 236 'per_page' => null, 237 'threaded' => null, 238 ), 239 'wp_get_comment_reply_link' => array( 240 'args' => array(), 241 'comment' => null, 242 'post' => null, 243 ), 244 'wp_get_comment_text' => array( 245 'comment_ID' => 0, 246 'args' => array(), 247 ), 248 'wp_get_comment_time' => array( 249 'd' => '', 250 'gmt' => false, 251 'translate' => false, 252 ), 253 'wp_get_comment_type' => array( 254 'comment_ID' => 0, 255 ), 256 'wp_get_custom_logo' => array( 257 'blog_id' => 0, 258 ), 259 'wp_get_dashboard_url' => array( 260 'user_id' => 0, 261 'path' => '', 262 'scheme' => 'admin', 263 ), 264 'wp_get_date_from_gmt' => array( 265 'string' => '', 266 'format' => 'Y-m-d H:i:s', 267 ), 268 'wp_get_day_link' => array( 269 'year' => false, 270 'month' => false, 271 'day' => false, 272 ), 273 'wp_get_default_comment_status' => array( 274 'post_type' => 'post', 275 'comment_type' => 'comment', 276 ), 277 'wp_get_delete_post_link' => array( 278 'id' => 0, 279 'deprecated' => '', 280 'force_delete' => false, 281 ), 282 'wp_get_dirsize' => array( 283 'directory' => '', 284 ), 285 'wp_get_edit_bookmark_link' => array( 286 'link' => 0, 287 ), 288 'wp_get_edit_comment_link' => array( 289 'comment_id' => 0, 290 ), 291 'wp_get_edit_post_link' => array( 292 'id' => 0, 293 'context' => 'display', 294 ), 295 'wp_get_edit_profile_url' => array( 296 'user_id' => 0, 297 'scheme' => 'admin' 298 ), 299 'wp_get_edit_tag_link' => array( 300 'tag_id' => 0, 301 'taxonomy' => 'post_tag' 302 ), 303 'wp_get_edit_term_link' => array( 304 'term_id' => 0, 305 'taxonomy' => '', 306 'object_type' => '', 307 ), 308 'wp_get_edit_user_link' => array( 309 'user_id' => null 310 ), 311 'wp_get_embed_template' => array(), 312 'wp_get_feed_link' => array( 313 'feed' => '' 314 ), 315 'wp_get_filesystem_method' => array( 316 'args' => array(), 317 'context' => '', 318 'allow_relaxed_file_ownership' => false 319 ), 320 'wp_get_file_description' => array( 321 'file' => '' 322 ), 323 'wp_get_footer' => array( 324 'name' => null 325 ), 326 'wp_get_front_page_template' => array(), 327 'wp_get_gmt_from_date' => array( 328 'string' => '', 329 'format' => 'Y-m-d H:i:s' 330 ), 331 'wp_get_header' => array( 332 'name' => null 333 ), 334 'wp_get_header_image' => array(), 335 'wp_get_header_image_tag' => array( 336 'attr' => array() 337 ), 338 'wp_get_header_textcolor' => array(), 339 'wp_get_header_video_url' => array(), 340 'wp_get_home_path' => array(), 341 'wp_get_home_template' => array(), 342 'wp_get_home_url' => array( 343 'blog_id' => null, 344 'path' => '', 345 'scheme' => null 346 ), 347 'wp_get_html_split_regex' => array(), 348 'wp_get_http_origin' => array(), 349 'wp_get_id_from_blogname' => array( 350 'slug' => '' 351 ), 352 'wp_get_images_from_uri' => array( 353 'uri' => '' 354 ), 355 'wp_get_default_feed' => array(), 356 'wp_get_date_template' => array(), 357 'wp_get_custom_header_markup' => array(), 358 'wp_get_current_user_id' => array(), 359 'wp_get_current_theme' => array(), 360 'wp_get_current_network_id' => array(), 361 'wp_get_current_blog_id' => array(), 362 'wp_get_comment_ID' => array(), 363 'wp_get_comment_author_rss' => array(), 118 364 'wp_restore_current_blog' => array(), 119 365 'wp_get_background_color' => array(), … … 124 370 'attr' => '', 125 371 ), 372 'wp_get_image_send_to_editor' => array( 373 'id' => 0, 374 'caption' => '', 375 'title' => '', 376 'align' => '', 377 'url' => '', 378 'rel' => false, 379 'size' => 'medium', 380 'alt' => '' 381 ), 382 'wp_get_image_tag' => array( 383 'id' => 0, 384 'alt' => '', 385 'title' => '', 386 'align' => '', 387 'size' => 'medium' 388 ), 389 'wp_get_index_template' => array(), 390 'wp_get_lastcommentmodified' => array( 391 'timezone' => 'server' 392 ), 393 'wp_get_lastpostdate' => array( 394 'timezone' => 'server', 395 'post_type' => 'any' 396 ), 397 'wp_get_lastpostmodified' => array( 398 'timezone' => 'server', 399 'post_type' => 'any' 400 ), 401 'wp_get_last_updated' => array( 402 'deprecated' => '', 403 'start' => 0, 404 'quantity' => 40 405 ), 406 'wp_get_locale' => array(), 407 'wp_get_locale_stylesheet_uri' => array(), 408 'wp_get_main_network_id' => array(), 409 'wp_get_media_item' => array( 410 'attachment_id' => 0, 411 'args' => null 412 ), 413 'wp_get_media_items' => array( 414 'post_id' => 0, 415 'errors' => array() 416 ), 417 'wp_get_month_link' => array( 418 'year' => false, 419 'month' => false 420 ), 421 'wp_get_next_comments_link' => array( 422 'label' => '', 423 'max_page' => 0 424 ), 425 'wp_get_next_posts_link' => array( 426 'label' => null, 427 'max_page' => 0 428 ), 429 'wp_get_next_posts_page_link' => array( 430 'max_page' => 0 431 ), 432 'wp_get_next_post_link' => array( 433 'format' => '%link »', 434 'link' => '%title', 435 'in_same_term' => false, 436 'excluded_terms' => '', 437 'taxonomy' => 'category' 438 ), 439 'wp_get_num_queries' => array(), 440 'wp_get_oembed_endpoint_url' => array( 441 'permalink' => '', 442 'format' => 'json' 443 ), 444 'wp_get_pagenum_link' => array( 445 'pagenum' => 1, 446 'escape' => true 447 ), 448 'wp_get_page_link' => array( 449 'post' => false, 450 'leavename' => false, 451 'sample' => false 452 ), 453 'wp_get_page_of_comment' => array( 454 'comment_ID' => 0, 455 'args' => array() 456 ), 457 'wp_get_page_template' => array(), 458 'wp_get_page_template_slug' => array( 459 'post' => null, 460 ), 461 'wp_get_page_uri' => array( 462 'page' => 0, 463 ), 464 'wp_get_parent_theme_file_path' => array( 465 'file' => '', 466 ), 467 'wp_get_parent_theme_file_uri' => array( 468 'file' => '', 469 ), 470 'wp_get_permalink' => array( 471 'post' => 0, 472 'leavename' => false, 473 ), 474 'wp_get_plugin_page_hook' => array( 475 'plugin_page' => '', 476 'parent_page' => '' 477 ), 478 'wp_get_plugin_page_hookname' => array( 479 'plugin_page' => '', 480 'parent_page' => '' 481 ), 482 'wp_get_posts_by_author_sql' => array( 483 'post_type' => '', 484 'full' => true, 485 'post_author' => null, 486 'public_only' => false 487 ), 488 'wp_get_posts_nav_link' => array( 489 'args' => array() 490 ), 491 'wp_get_post_comments_feed_link' => array( 492 'post_id' => 0, 493 'feed' => '' 494 ), 495 'wp_get_post_embed_url' => array( 496 'post_id' => null, 497 ), 498 'wp_get_post_embed_html' => array( 499 'width' => 0, 500 'height' => 0, 501 'post' => null 502 ), 503 'wp_get_post_field' => array( 504 'field' => '', 505 'post' => null, 506 'context' => 'display' 507 ), 508 'wp_get_post_format' => array( 509 'post' => null, 510 ), 511 'wp_get_post_format_string' => array( 512 'slug' => '', 513 ), 514 'wp_get_post_mime_type' => array( 515 'ID' => '', 516 ), 517 'wp_get_post_status' => array( 518 'ID' => '', 519 ), 520 'wp_get_post_modified_time' => array( 521 'd' => 'U', 522 'gmt' => false, 523 'post' => null, 524 'translate' => false 525 ), 526 'wp_get_post_permalink' => array( 527 'id' => 0, 528 'leavename' => false, 529 'sample' => false 530 ), 531 'wp_get_raw_theme_root' => array( 532 'stylesheet_or_template' => '', 533 'skip_cache' => false 534 ), 535 'wp_get_random_header_image' => array(), 536 'wp_get_queried_object_id' => array(), 537 'wp_get_query_template' => array( 538 'type' => '', 539 'templates' => array() 540 ), 541 'wp_get_private_posts_cap_sql' => array( 542 'post_type' => '', 543 ), 544 'wp_get_previous_post_link' => array( 545 'format' => '« %link', 546 'link' => '%title', 547 'in_same_term' => false, 548 'excluded_terms' => '', 549 'taxonomy' => 'category' 550 ), 551 'wp_get_previous_posts_page_link' => array(), 552 'wp_get_previous_posts_link' => array( 553 'label' => null 554 ), 555 'wp_get_previous_comments_link' => array( 556 'label' => '' 557 ), 558 'wp_get_post_type_archive_template' => array(), 559 'wp_get_post_type_archive_link' => array( 560 'post_type' => '', 561 ), 562 'wp_get_post_type_archive_feed_link' => array( 563 'post_type' => '', 564 'feed' => '', 565 ), 566 'wp_get_post_type' => array( 567 'post' => null, 568 ), 569 'wp_get_post_thumbnail_id' => array( 570 'post' => null, 571 ), 572 'wp_get_post_time' => array( 573 'd' => 'U', 574 'gmt' => false, 575 'post' => null, 576 'translate' => false 577 ), 578 'wp_get_rest_url' => array( 579 'blog_id' => null, 580 'path' => '/', 581 'scheme' => 'rest' 582 ), 583 'wp_get_sample_permalink_html' => array( 584 'id' => 0, 585 'new_title' => null, 586 'new_slug' => null 587 ), 588 'wp_get_search_comments_feed_link' => array( 589 'search_query' => '', 590 'feed' => '', 591 ), 592 'wp_get_search_feed_link' => array( 593 'search_query' => '', 594 'feed' => '', 595 ), 596 'wp_get_search_form' => array( 597 'echo' => true 598 ), 599 'wp_get_search_link' => array( 600 'query' => '' 601 ), 602 'wp_get_search_query' => array( 603 'escaped' => true 604 ), 605 'wp_get_search_template' => array(), 606 'wp_get_sidebar' => array( 607 'name' => null 608 ), 609 'wp_get_single_template' => array(), 610 'wp_get_site_icon_url' => array( 611 'size' => 512, 612 'url' => '', 613 'blog_id' => 0 614 ), 615 'wp_get_site_url' => array( 616 'blog_id' => null, 617 'path' => '', 618 'scheme' => null 619 ), 620 'wp_get_space_allowed' => array(), 621 'wp_get_space_used' => array(), 622 'wp_get_status_header_desc' => array( 623 'code' => 0 624 ), 625 'wp_get_stylesheet' => array(), 626 'wp_get_stylesheet_directory' => array(), 627 'wp_get_stylesheet_directory_uri' => array(), 628 'wp_get_stylesheet_uri' => array(), 629 'wp_get_submit_button' => array( 630 'text' => '', 631 'type' => 'primary large', 632 'name' => 'submit', 633 'wrap' => true, 634 'other_attributes' => '' 635 ), 636 'wp_get_tag_feed_link' => array( 637 'tag_id' => 0, 638 'feed' => '' 639 ), 640 'wp_get_tag_link' => array( 641 'tag' => 0 642 ), 643 'wp_get_tag_regex' => array( 644 'tag' => '' 645 ), 646 'wp_get_tag_template' => array(), 647 'wp_get_taxonomy_template' => array(), 648 'wp_get_template' => array(), 649 'wp_get_template_directory' => array(), 650 'wp_get_template_directory_uri' => array(), 651 'wp_get_template_part' => array( 652 'slug' => '', 653 'name' => null 654 ), 655 'wp_get_temp_dir' => array(), 656 'wp_get_term_feed_link' => array( 657 'term_id' => 0, 658 'taxonomy' => 'category', 659 'feed' => '' 660 ), 661 'wp_get_term_field' => array( 662 'field' => '', 663 'term' => '', 664 'taxonomy' => '', 665 'context' => 'display' 666 ), 667 'wp_get_term_link' => array( 668 'term' => '', 669 'taxonomy' => '', 670 ), 671 'wp_get_term_parents_list' => array( 672 'term' => '', 673 'taxonomy' => '', 674 'args' => array() 675 ), 676 'wp_get_theme_file_path' => array( 677 'file' => '', 678 ), 679 'wp_get_theme_file_uri' => array( 680 'file' => '', 681 ), 682 'wp_get_theme_mod' => array( 683 'name' => '', 684 'default' => false, 685 ), 686 'wp_get_theme_root' => array( 687 'stylesheet_or_template' => false, 688 ), 689 'wp_get_theme_root_uri' => array( 690 'stylesheet_or_template' => false, 691 'theme_root' => false, 692 ), 693 'wp_wp_get_attachment_link' => array( 694 'id' => 0, 695 'size' => 'thumbnail', 696 'permalink' => false, 697 'icon' => false, 698 'text' => false, 699 'attr' => '' 700 ), 701 'wp_get_the_archive_description' => array(), 702 'wp_get_the_archive_title' => array(), 703 'wp_get_the_author' => array( 704 'deprecated' => '' 705 ), 706 'wp_get_the_author_link' => array(), 707 'wp_get_the_author_posts' => array(), 708 'wp_get_the_author_posts_link' => array(), 709 'wp_get_the_category_by_ID' => array( 710 'cat_ID' => 0 711 ), 712 'wp_get_the_category_list' => array( 713 'separator' => '', 714 'parents' => '', 715 'post_id' => false 716 ), 717 'wp_get_the_category_rss' => array( 718 'type' => null 719 ), 720 'wp_get_the_comments_navigation' => array( 721 'args' => array() 722 ), 723 'wp_get_the_comments_pagination' => array( 724 'args' => array() 725 ), 726 'wp_get_the_content' => array( 727 'more_link_text' => null, 728 'strip_teaser' => false 729 ), 730 'wp_get_the_content_feed' => array( 731 'feed_type' => null, 732 ), 733 'wp_get_the_date' => array( 734 'd' => '', 735 'post' => null, 736 ), 737 'wp_get_the_excerpt' => array( 738 'post' => null, 739 ), 740 'wp_get_the_generator' => array( 741 'type' => '', 742 ), 743 'wp_get_the_guid' => array( 744 'post' => 0, 745 ), 746 'wp_get_the_ID' => array(), 126 747 )); 127 748 … … 147 768 public function init_shortcodes(){ 148 769 149 $unset_shortcodes = array( 'wp_get_option', 'wp_get_ post_meta', 'wp_get_metadata' );770 $unset_shortcodes = array( 'wp_get_option', 'wp_get_network_option', 'wp_get_post_meta', 'wp_get_metadata' ); 150 771 foreach ( $unset_shortcodes as $key ) { 151 772 if( isset( self::$shortcodes[$key] ) ) { … … 202 823 203 824 /** 825 * wp_get_network_option shortcode callback. 826 * 827 * @since 1.0.1 828 */ 829 public function get_network_option( $atts ) { 830 831 $args = shortcode_atts( array( 832 'network_id' => 0, 833 'option' => '', 834 'default' => false, 835 'subkey' => '', 836 ), $atts ); 837 838 if ( ! empty( $args['option'] ) ) { 839 $value = get_option( $args['option'], $args['default'] ); 840 if ( ! empty( $args['subkey'] ) ) { 841 return isset( $value[ $args['subkey'] ] ) ? $value[ $args['subkey'] ] : ''; 842 } 843 return $value; 844 } 845 } 846 847 /** 204 848 * wp_get_option shortcode callback. 205 849 * -
bkc-wp-shortcodes/trunk/readme.txt
r1736516 r1738641 35 35 = 1.0.0 = 36 36 * Initial release. 37 38 = 1.0.1 = 39 * Shortcodes generator array updated.
Note: See TracChangeset for help on using the changeset viewer.