@@ -7,10 +7,10 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | function __construct() { |
| 9 | 9 | $widget_ops = array( |
| 10 | - 'description' => __( 'Displays "GD Features" widget', 'geodirectory' ), |
|
| 10 | + 'description' => __('Displays "GD Features" widget', 'geodirectory'), |
|
| 11 | 11 | 'classname' => 'widget_gd_features', |
| 12 | 12 | ); |
| 13 | - parent::__construct( false, $name = _x( 'GD > Features', 'widget name', 'geodirectory' ), $widget_ops ); |
|
| 13 | + parent::__construct(false, $name = _x('GD > Features', 'widget name', 'geodirectory'), $widget_ops); |
|
| 14 | 14 | |
| 15 | 15 | } |
| 16 | 16 | |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | * @param array $args Widget arguments. |
| 21 | 21 | * @param array $instance The widget settings, as saved by the user. |
| 22 | 22 | */ |
| 23 | - function widget( $args, $instance ) { |
|
| 24 | - extract( $args ); |
|
| 23 | + function widget($args, $instance) { |
|
| 24 | + extract($args); |
|
| 25 | 25 | |
| 26 | 26 | $title = empty($instance['title']) ? '' : apply_filters('gd_features_widget_title', __($instance['title'], 'geodirectory')); |
| 27 | 27 | $icon_color = $instance['icon_color']; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | function form($instance) |
| 300 | 300 | { |
| 301 | 301 | //widgetform in backend |
| 302 | - $instance = wp_parse_args((array)$instance, array( |
|
| 302 | + $instance = wp_parse_args((array) $instance, array( |
|
| 303 | 303 | 'title' => '', |
| 304 | 304 | 'icon_color' => '#757575', |
| 305 | 305 | 'title1' => '', |
@@ -400,183 +400,183 @@ discard block |
||
| 400 | 400 | </p> |
| 401 | 401 | |
| 402 | 402 | <p class="features-title"> |
| 403 | - <label><?php echo __( 'Title 1:', 'geodirectory' ); ?></label> |
|
| 404 | - <input name="<?php echo $this->get_field_name( 'title1' ); ?>" type="text" value="<?php echo esc_attr($title1); ?>" class="widefat" /> |
|
| 403 | + <label><?php echo __('Title 1:', 'geodirectory'); ?></label> |
|
| 404 | + <input name="<?php echo $this->get_field_name('title1'); ?>" type="text" value="<?php echo esc_attr($title1); ?>" class="widefat" /> |
|
| 405 | 405 | </p> |
| 406 | 406 | |
| 407 | 407 | <p class="features-image"> |
| 408 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 409 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image1' ); ?>" value="<?php echo esc_attr($image1); ?>" /> |
|
| 408 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 409 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image1'); ?>" value="<?php echo esc_attr($image1); ?>" /> |
|
| 410 | 410 | </p> |
| 411 | 411 | |
| 412 | 412 | <p class="features-desc"> |
| 413 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 414 | - <textarea name="<?php echo $this->get_field_name( 'desc1' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc1); ?></textarea> |
|
| 413 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 414 | + <textarea name="<?php echo $this->get_field_name('desc1'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc1); ?></textarea> |
|
| 415 | 415 | </p> |
| 416 | 416 | |
| 417 | 417 | <p class="features-title"> |
| 418 | - <label><?php echo __( 'Title 2:', 'geodirectory' ); ?></label> |
|
| 419 | - <input name="<?php echo $this->get_field_name( 'title2' ); ?>" type="text" value="<?php echo esc_attr($title2); ?>" class="widefat" /> |
|
| 418 | + <label><?php echo __('Title 2:', 'geodirectory'); ?></label> |
|
| 419 | + <input name="<?php echo $this->get_field_name('title2'); ?>" type="text" value="<?php echo esc_attr($title2); ?>" class="widefat" /> |
|
| 420 | 420 | </p> |
| 421 | 421 | |
| 422 | 422 | <p class="features-image"> |
| 423 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 424 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image2' ); ?>" value="<?php echo esc_attr($image2); ?>" /> |
|
| 423 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 424 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image2'); ?>" value="<?php echo esc_attr($image2); ?>" /> |
|
| 425 | 425 | </p> |
| 426 | 426 | |
| 427 | 427 | <p class="features-desc"> |
| 428 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 429 | - <textarea name="<?php echo $this->get_field_name( 'desc2' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc2); ?></textarea> |
|
| 428 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 429 | + <textarea name="<?php echo $this->get_field_name('desc2'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc2); ?></textarea> |
|
| 430 | 430 | </p> |
| 431 | 431 | |
| 432 | 432 | <p class="features-title"> |
| 433 | - <label><?php echo __( 'Title 3:', 'geodirectory' ); ?></label> |
|
| 434 | - <input name="<?php echo $this->get_field_name( 'title3' ); ?>" type="text" value="<?php echo esc_attr($title3); ?>" class="widefat" /> |
|
| 433 | + <label><?php echo __('Title 3:', 'geodirectory'); ?></label> |
|
| 434 | + <input name="<?php echo $this->get_field_name('title3'); ?>" type="text" value="<?php echo esc_attr($title3); ?>" class="widefat" /> |
|
| 435 | 435 | </p> |
| 436 | 436 | |
| 437 | 437 | <p class="features-image"> |
| 438 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 439 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image3' ); ?>" value="<?php echo esc_attr($image3); ?>" /> |
|
| 438 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 439 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image3'); ?>" value="<?php echo esc_attr($image3); ?>" /> |
|
| 440 | 440 | </p> |
| 441 | 441 | |
| 442 | 442 | <p class="features-desc"> |
| 443 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 444 | - <textarea name="<?php echo $this->get_field_name( 'desc3' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc3); ?></textarea> |
|
| 443 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 444 | + <textarea name="<?php echo $this->get_field_name('desc3'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc3); ?></textarea> |
|
| 445 | 445 | </p> |
| 446 | 446 | |
| 447 | 447 | <p class="features-title"> |
| 448 | - <label><?php echo __( 'Title 4:', 'geodirectory' ); ?></label> |
|
| 449 | - <input name="<?php echo $this->get_field_name( 'title4' ); ?>" type="text" value="<?php echo esc_attr($title4); ?>" class="widefat" /> |
|
| 448 | + <label><?php echo __('Title 4:', 'geodirectory'); ?></label> |
|
| 449 | + <input name="<?php echo $this->get_field_name('title4'); ?>" type="text" value="<?php echo esc_attr($title4); ?>" class="widefat" /> |
|
| 450 | 450 | </p> |
| 451 | 451 | |
| 452 | 452 | <p class="features-image"> |
| 453 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 454 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image4' ); ?>" value="<?php echo esc_attr($image4); ?>" /> |
|
| 453 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 454 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image4'); ?>" value="<?php echo esc_attr($image4); ?>" /> |
|
| 455 | 455 | </p> |
| 456 | 456 | |
| 457 | 457 | <p class="features-desc"> |
| 458 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 459 | - <textarea name="<?php echo $this->get_field_name( 'desc4' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc4); ?></textarea> |
|
| 458 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 459 | + <textarea name="<?php echo $this->get_field_name('desc4'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc4); ?></textarea> |
|
| 460 | 460 | </p> |
| 461 | 461 | |
| 462 | 462 | <p class="features-title"> |
| 463 | - <label><?php echo __( 'Title 5:', 'geodirectory' ); ?></label> |
|
| 464 | - <input name="<?php echo $this->get_field_name( 'title5' ); ?>" type="text" value="<?php echo esc_attr($title5); ?>" class="widefat" /> |
|
| 463 | + <label><?php echo __('Title 5:', 'geodirectory'); ?></label> |
|
| 464 | + <input name="<?php echo $this->get_field_name('title5'); ?>" type="text" value="<?php echo esc_attr($title5); ?>" class="widefat" /> |
|
| 465 | 465 | </p> |
| 466 | 466 | |
| 467 | 467 | <p class="features-image"> |
| 468 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 469 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image5' ); ?>" value="<?php echo esc_attr($image5); ?>" /> |
|
| 468 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 469 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image5'); ?>" value="<?php echo esc_attr($image5); ?>" /> |
|
| 470 | 470 | </p> |
| 471 | 471 | |
| 472 | 472 | <p class="features-desc"> |
| 473 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 474 | - <textarea name="<?php echo $this->get_field_name( 'desc5' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc5); ?></textarea> |
|
| 473 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 474 | + <textarea name="<?php echo $this->get_field_name('desc5'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc5); ?></textarea> |
|
| 475 | 475 | </p> |
| 476 | 476 | |
| 477 | 477 | <p class="features-title"> |
| 478 | - <label><?php echo __( 'Title 6:', 'geodirectory' ); ?></label> |
|
| 479 | - <input name="<?php echo $this->get_field_name( 'title6' ); ?>" type="text" value="<?php echo esc_attr($title6); ?>" class="widefat" /> |
|
| 478 | + <label><?php echo __('Title 6:', 'geodirectory'); ?></label> |
|
| 479 | + <input name="<?php echo $this->get_field_name('title6'); ?>" type="text" value="<?php echo esc_attr($title6); ?>" class="widefat" /> |
|
| 480 | 480 | </p> |
| 481 | 481 | |
| 482 | 482 | <p class="features-image"> |
| 483 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 484 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image6' ); ?>" value="<?php echo esc_attr($image6); ?>" /> |
|
| 483 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 484 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image6'); ?>" value="<?php echo esc_attr($image6); ?>" /> |
|
| 485 | 485 | </p> |
| 486 | 486 | |
| 487 | 487 | <p class="features-desc"> |
| 488 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 489 | - <textarea name="<?php echo $this->get_field_name( 'desc6' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc6); ?></textarea> |
|
| 488 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 489 | + <textarea name="<?php echo $this->get_field_name('desc6'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc6); ?></textarea> |
|
| 490 | 490 | </p> |
| 491 | 491 | |
| 492 | 492 | <p class="features-title"> |
| 493 | - <label><?php echo __( 'Title 7:', 'geodirectory' ); ?></label> |
|
| 494 | - <input name="<?php echo $this->get_field_name( 'title7' ); ?>" type="text" value="<?php echo esc_attr($title7); ?>" class="widefat" /> |
|
| 493 | + <label><?php echo __('Title 7:', 'geodirectory'); ?></label> |
|
| 494 | + <input name="<?php echo $this->get_field_name('title7'); ?>" type="text" value="<?php echo esc_attr($title7); ?>" class="widefat" /> |
|
| 495 | 495 | </p> |
| 496 | 496 | |
| 497 | 497 | <p class="features-image"> |
| 498 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 499 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image7' ); ?>" value="<?php echo esc_attr($image7); ?>" /> |
|
| 498 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 499 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image7'); ?>" value="<?php echo esc_attr($image7); ?>" /> |
|
| 500 | 500 | </p> |
| 501 | 501 | |
| 502 | 502 | <p class="features-desc"> |
| 503 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 504 | - <textarea name="<?php echo $this->get_field_name( 'desc7' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc7); ?></textarea> |
|
| 503 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 504 | + <textarea name="<?php echo $this->get_field_name('desc7'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc7); ?></textarea> |
|
| 505 | 505 | </p> |
| 506 | 506 | |
| 507 | 507 | <p class="features-title"> |
| 508 | - <label><?php echo __( 'Title 8:', 'geodirectory' ); ?></label> |
|
| 509 | - <input name="<?php echo $this->get_field_name( 'title8' ); ?>" type="text" value="<?php echo esc_attr($title8); ?>" class="widefat" /> |
|
| 508 | + <label><?php echo __('Title 8:', 'geodirectory'); ?></label> |
|
| 509 | + <input name="<?php echo $this->get_field_name('title8'); ?>" type="text" value="<?php echo esc_attr($title8); ?>" class="widefat" /> |
|
| 510 | 510 | </p> |
| 511 | 511 | |
| 512 | 512 | <p class="features-image"> |
| 513 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 514 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image8' ); ?>" value="<?php echo esc_attr($image8); ?>" /> |
|
| 513 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 514 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image8'); ?>" value="<?php echo esc_attr($image8); ?>" /> |
|
| 515 | 515 | </p> |
| 516 | 516 | |
| 517 | 517 | <p class="features-desc"> |
| 518 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 519 | - <textarea name="<?php echo $this->get_field_name( 'desc8' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc8); ?></textarea> |
|
| 518 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 519 | + <textarea name="<?php echo $this->get_field_name('desc8'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc8); ?></textarea> |
|
| 520 | 520 | </p> |
| 521 | 521 | |
| 522 | 522 | <p class="features-title"> |
| 523 | - <label><?php echo __( 'Title 9:', 'geodirectory' ); ?></label> |
|
| 524 | - <input name="<?php echo $this->get_field_name( 'title9' ); ?>" type="text" value="<?php echo esc_attr($title9); ?>" class="widefat" /> |
|
| 523 | + <label><?php echo __('Title 9:', 'geodirectory'); ?></label> |
|
| 524 | + <input name="<?php echo $this->get_field_name('title9'); ?>" type="text" value="<?php echo esc_attr($title9); ?>" class="widefat" /> |
|
| 525 | 525 | </p> |
| 526 | 526 | |
| 527 | 527 | <p class="features-image"> |
| 528 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 529 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image9' ); ?>" value="<?php echo esc_attr($image9); ?>" /> |
|
| 528 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 529 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image9'); ?>" value="<?php echo esc_attr($image9); ?>" /> |
|
| 530 | 530 | </p> |
| 531 | 531 | |
| 532 | 532 | <p class="features-desc"> |
| 533 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 534 | - <textarea name="<?php echo $this->get_field_name( 'desc9' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc9); ?></textarea> |
|
| 533 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 534 | + <textarea name="<?php echo $this->get_field_name('desc9'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc9); ?></textarea> |
|
| 535 | 535 | </p> |
| 536 | 536 | |
| 537 | 537 | <p class="features-title"> |
| 538 | - <label><?php echo __( 'Title 10:', 'geodirectory' ); ?></label> |
|
| 539 | - <input name="<?php echo $this->get_field_name( 'title10' ); ?>" type="text" value="<?php echo esc_attr($title10); ?>" class="widefat" /> |
|
| 538 | + <label><?php echo __('Title 10:', 'geodirectory'); ?></label> |
|
| 539 | + <input name="<?php echo $this->get_field_name('title10'); ?>" type="text" value="<?php echo esc_attr($title10); ?>" class="widefat" /> |
|
| 540 | 540 | </p> |
| 541 | 541 | |
| 542 | 542 | <p class="features-image"> |
| 543 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 544 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image10' ); ?>" value="<?php echo esc_attr($image10); ?>" /> |
|
| 543 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 544 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image10'); ?>" value="<?php echo esc_attr($image10); ?>" /> |
|
| 545 | 545 | </p> |
| 546 | 546 | |
| 547 | 547 | <p class="features-desc"> |
| 548 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 549 | - <textarea name="<?php echo $this->get_field_name( 'desc10' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc10); ?></textarea> |
|
| 548 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 549 | + <textarea name="<?php echo $this->get_field_name('desc10'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc10); ?></textarea> |
|
| 550 | 550 | </p> |
| 551 | 551 | |
| 552 | 552 | <p class="features-title"> |
| 553 | - <label><?php echo __( 'Title 11:', 'geodirectory' ); ?></label> |
|
| 554 | - <input name="<?php echo $this->get_field_name( 'title11' ); ?>" type="text" value="<?php echo esc_attr($title11); ?>" class="widefat" /> |
|
| 553 | + <label><?php echo __('Title 11:', 'geodirectory'); ?></label> |
|
| 554 | + <input name="<?php echo $this->get_field_name('title11'); ?>" type="text" value="<?php echo esc_attr($title11); ?>" class="widefat" /> |
|
| 555 | 555 | </p> |
| 556 | 556 | |
| 557 | 557 | <p class="features-image"> |
| 558 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 559 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image11' ); ?>" value="<?php echo esc_attr($image11); ?>" /> |
|
| 558 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 559 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image11'); ?>" value="<?php echo esc_attr($image11); ?>" /> |
|
| 560 | 560 | </p> |
| 561 | 561 | |
| 562 | 562 | <p class="features-desc"> |
| 563 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 564 | - <textarea name="<?php echo $this->get_field_name( 'desc11' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc11); ?></textarea> |
|
| 563 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 564 | + <textarea name="<?php echo $this->get_field_name('desc11'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc11); ?></textarea> |
|
| 565 | 565 | </p> |
| 566 | 566 | |
| 567 | 567 | <p class="features-title"> |
| 568 | - <label><?php echo __( 'Title 12:', 'geodirectory' ); ?></label> |
|
| 569 | - <input name="<?php echo $this->get_field_name( 'title12' ); ?>" type="text" value="<?php echo esc_attr($title12); ?>" class="widefat" /> |
|
| 568 | + <label><?php echo __('Title 12:', 'geodirectory'); ?></label> |
|
| 569 | + <input name="<?php echo $this->get_field_name('title12'); ?>" type="text" value="<?php echo esc_attr($title12); ?>" class="widefat" /> |
|
| 570 | 570 | </p> |
| 571 | 571 | |
| 572 | 572 | <p class="features-image"> |
| 573 | - <label><?php echo __( 'Image URL:', 'geodirectory' ); ?></label> |
|
| 574 | - <input type="text" class="widefat" name="<?php echo $this->get_field_name( 'image12' ); ?>" value="<?php echo esc_attr($image12); ?>" /> |
|
| 573 | + <label><?php echo __('Image URL:', 'geodirectory'); ?></label> |
|
| 574 | + <input type="text" class="widefat" name="<?php echo $this->get_field_name('image12'); ?>" value="<?php echo esc_attr($image12); ?>" /> |
|
| 575 | 575 | </p> |
| 576 | 576 | |
| 577 | 577 | <p class="features-desc"> |
| 578 | - <label><?php echo __( 'Description:', 'geodirectory' ); ?></label> |
|
| 579 | - <textarea name="<?php echo $this->get_field_name( 'desc12' ); ?>" rows="3" class="widefat"><?php echo esc_attr($desc12); ?></textarea> |
|
| 578 | + <label><?php echo __('Description:', 'geodirectory'); ?></label> |
|
| 579 | + <textarea name="<?php echo $this->get_field_name('desc12'); ?>" rows="3" class="widefat"><?php echo esc_attr($desc12); ?></textarea> |
|
| 580 | 580 | </p> |
| 581 | 581 | <?php |
| 582 | 582 | } |
@@ -584,13 +584,13 @@ discard block |
||
| 584 | 584 | } |
| 585 | 585 | register_widget("Geodir_Features_Widget"); |
| 586 | 586 | function gd_features_parse_image($image, $icon_color) { |
| 587 | - if (substr( $image, 0, 4 ) === "http") { |
|
| 588 | - $image = '<img src="'.$image.'" />'; |
|
| 589 | - } elseif (substr( $image, 0, 3 ) === "fa-") { |
|
| 587 | + if (substr($image, 0, 4) === "http") { |
|
| 588 | + $image = '<img src="' . $image . '" />'; |
|
| 589 | + } elseif (substr($image, 0, 3) === "fa-") { |
|
| 590 | 590 | if (empty($icon_color)) { |
| 591 | 591 | $icon_color = '#757575'; |
| 592 | 592 | } |
| 593 | - $image = '<i style="color:'.$icon_color.'" class="fa '.$image.'"></i>'; |
|
| 593 | + $image = '<i style="color:' . $icon_color . '" class="fa ' . $image . '"></i>'; |
|
| 594 | 594 | } |
| 595 | 595 | return $image; |
| 596 | 596 | } |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * GeoDirectory Listing Slider Widget |
|
| 4 | - * |
|
| 5 | - * @since 1.0.0 |
|
| 6 | - * |
|
| 7 | - * @package GeoDirectory |
|
| 8 | - */ |
|
| 3 | + * GeoDirectory Listing Slider Widget |
|
| 4 | + * |
|
| 5 | + * @since 1.0.0 |
|
| 6 | + * |
|
| 7 | + * @package GeoDirectory |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * GeoDirectory listing slider widget class. |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | {
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | - * Register the listing slider widget. |
|
| 20 | - * |
|
| 21 | - * @since 1.0.0 |
|
| 19 | + * Register the listing slider widget. |
|
| 20 | + * |
|
| 21 | + * @since 1.0.0 |
|
| 22 | 22 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
| 23 | - */ |
|
| 23 | + */ |
|
| 24 | 24 | function __construct() {
|
| 25 | 25 | $widget_ops = array('classname' => 'geodir_listing_slider_view', 'description' => __('GD > Listing Slider', 'geodirectory'));
|
| 26 | 26 | parent::__construct( |
@@ -30,32 +30,32 @@ discard block |
||
| 30 | 30 | ); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Front-end display content for listing slider widget. |
|
| 35 | - * |
|
| 36 | - * @since 1.0.0 |
|
| 33 | + /** |
|
| 34 | + * Front-end display content for listing slider widget. |
|
| 35 | + * |
|
| 36 | + * @since 1.0.0 |
|
| 37 | 37 | * @since 1.5.1 Declare function public. |
| 38 | - * |
|
| 39 | - * @param array $args Widget arguments. |
|
| 40 | - * @param array $instance Saved values from database. |
|
| 41 | - */ |
|
| 38 | + * |
|
| 39 | + * @param array $args Widget arguments. |
|
| 40 | + * @param array $instance Saved values from database. |
|
| 41 | + */ |
|
| 42 | 42 | public function widget($args, $instance) |
| 43 | 43 | {
|
| 44 | 44 | geodir_listing_slider_widget_output($args, $instance); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Sanitize listing slider widget form values as they are saved. |
|
| 49 | - * |
|
| 50 | - * @since 1.0.0 |
|
| 47 | + /** |
|
| 48 | + * Sanitize listing slider widget form values as they are saved. |
|
| 49 | + * |
|
| 50 | + * @since 1.0.0 |
|
| 51 | 51 | * @since 1.5.1 Declare function public. |
| 52 | - * |
|
| 53 | - * @param array $new_instance Values just sent to be saved. |
|
| 54 | - * @param array $old_instance Previously saved values from database. |
|
| 55 | - * |
|
| 56 | - * @return array Updated safe values to be saved. |
|
| 57 | - */ |
|
| 58 | - public function update($new_instance, $old_instance) |
|
| 52 | + * |
|
| 53 | + * @param array $new_instance Values just sent to be saved. |
|
| 54 | + * @param array $old_instance Previously saved values from database. |
|
| 55 | + * |
|
| 56 | + * @return array Updated safe values to be saved. |
|
| 57 | + */ |
|
| 58 | + public function update($new_instance, $old_instance) |
|
| 59 | 59 | {
|
| 60 | 60 | //save the widget |
| 61 | 61 | $instance = $old_instance; |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | return $instance; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * Back-end listing slider widget settings form. |
|
| 83 | - * |
|
| 84 | - * @since 1.0.0 |
|
| 81 | + /** |
|
| 82 | + * Back-end listing slider widget settings form. |
|
| 83 | + * |
|
| 84 | + * @since 1.0.0 |
|
| 85 | 85 | * @since 1.5.1 Declare function public. |
| 86 | - * |
|
| 87 | - * @param array $instance Previously saved values from database. |
|
| 88 | - */ |
|
| 89 | - public function form($instance) |
|
| 86 | + * |
|
| 87 | + * @param array $instance Previously saved values from database. |
|
| 88 | + */ |
|
| 89 | + public function form($instance) |
|
| 90 | 90 | {
|
| 91 | 91 | |
| 92 | 92 | //widgetform in backend |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | {
|
| 91 | 91 | |
| 92 | 92 | //widgetform in backend |
| 93 | - $instance = wp_parse_args((array)$instance, |
|
| 93 | + $instance = wp_parse_args((array) $instance, |
|
| 94 | 94 | array('title' => '',
|
| 95 | 95 | 'post_type' => '', |
| 96 | 96 | 'category' => '', |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | ?> |
| 147 | 147 | |
| 148 | 148 | <p> |
| 149 | - <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
|
|
| 149 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
|
|
| 150 | 150 | |
| 151 | 151 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
| 152 | 152 | name="<?php echo $this->get_field_name('title'); ?>" type="text"
|
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | <p> |
| 158 | 158 | <label |
| 159 | - for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
|
|
| 159 | + for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?>
|
|
| 160 | 160 | |
| 161 | 161 | <?php $postypes = geodir_get_posttypes(); ?> |
| 162 | 162 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | <p> |
| 182 | 182 | <label |
| 183 | - for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory');?>
|
|
| 183 | + for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory'); ?>
|
|
| 184 | 184 | |
| 185 | 185 | <?php |
| 186 | 186 | $category_taxonomy = geodir_get_taxonomies('gd_place');
|
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | </p> |
| 218 | 218 | <p> |
| 219 | 219 | <label |
| 220 | - for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts(total):', 'geodirectory');?>
|
|
| 220 | + for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts(total):', 'geodirectory'); ?>
|
|
| 221 | 221 | <input class="widefat" id="<?php echo $this->get_field_id('post_number'); ?>"
|
| 222 | 222 | name="<?php echo $this->get_field_name('post_number'); ?>" type="text"
|
| 223 | 223 | value="<?php echo esc_attr($post_number); ?>"/> |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | <p> |
| 228 | 228 | <label |
| 229 | - for="<?php echo $this->get_field_id('max_show'); ?>"><?php _e('Number of posts(shown at one time, requires a slide width to be set):', 'geodirectory');?>
|
|
| 229 | + for="<?php echo $this->get_field_id('max_show'); ?>"><?php _e('Number of posts(shown at one time, requires a slide width to be set):', 'geodirectory'); ?>
|
|
| 230 | 230 | <input class="widefat" id="<?php echo $this->get_field_id('max_show'); ?>"
|
| 231 | 231 | name="<?php echo $this->get_field_name('max_show'); ?>" type="text"
|
| 232 | 232 | value="<?php echo esc_attr($max_show); ?>"/> |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | <p> |
| 237 | 237 | <label |
| 238 | - for="<?php echo $this->get_field_id('slide_width'); ?>"><?php _e('Slide width(leave blank unless showing more than one slide at a time, ex: 210):', 'geodirectory');?>
|
|
| 238 | + for="<?php echo $this->get_field_id('slide_width'); ?>"><?php _e('Slide width(leave blank unless showing more than one slide at a time, ex: 210):', 'geodirectory'); ?>
|
|
| 239 | 239 | <input class="widefat" id="<?php echo $this->get_field_id('slide_width'); ?>"
|
| 240 | 240 | name="<?php echo $this->get_field_name('slide_width'); ?>" type="text"
|
| 241 | 241 | value="<?php echo esc_attr($slide_width); ?>"/> |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | <p> |
| 246 | 246 | <label |
| 247 | - for="<?php echo $this->get_field_id('animation'); ?>"><?php _e('Animation:', 'geodirectory');?>
|
|
| 247 | + for="<?php echo $this->get_field_id('animation'); ?>"><?php _e('Animation:', 'geodirectory'); ?>
|
|
| 248 | 248 | |
| 249 | 249 | <select class="widefat" id="<?php echo $this->get_field_id('animation'); ?>"
|
| 250 | 250 | name="<?php echo $this->get_field_name('animation'); ?>">
|
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | <p> |
| 264 | 264 | <label |
| 265 | - for="<?php echo $this->get_field_id('slideshowSpeed'); ?>"><?php _e('Slide Show Speed: (milliseconds)', 'geodirectory');?>
|
|
| 265 | + for="<?php echo $this->get_field_id('slideshowSpeed'); ?>"><?php _e('Slide Show Speed: (milliseconds)', 'geodirectory'); ?>
|
|
| 266 | 266 | |
| 267 | 267 | <input class="widefat" id="<?php echo $this->get_field_id('slideshowSpeed'); ?>"
|
| 268 | 268 | name="<?php echo $this->get_field_name('slideshowSpeed'); ?>" type="text"
|
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | <p> |
| 274 | 274 | <label |
| 275 | - for="<?php echo $this->get_field_id('animationSpeed'); ?>"><?php _e('Animation Speed: (milliseconds)', 'geodirectory');?>
|
|
| 275 | + for="<?php echo $this->get_field_id('animationSpeed'); ?>"><?php _e('Animation Speed: (milliseconds)', 'geodirectory'); ?>
|
|
| 276 | 276 | |
| 277 | 277 | <input class="widefat" id="<?php echo $this->get_field_id('animationSpeed'); ?>"
|
| 278 | 278 | name="<?php echo $this->get_field_name('animationSpeed'); ?>" type="text"
|
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | <p> |
| 284 | 284 | <label |
| 285 | - for="<?php echo $this->get_field_id('slideshow'); ?>"><?php _e('SlideShow:', 'geodirectory');?>
|
|
| 285 | + for="<?php echo $this->get_field_id('slideshow'); ?>"><?php _e('SlideShow:', 'geodirectory'); ?>
|
|
| 286 | 286 | |
| 287 | 287 | <input type="checkbox" <?php if ($slideshow) {
|
| 288 | 288 | echo 'checked="checked"'; |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | <p> |
| 296 | 296 | <label |
| 297 | - for="<?php echo $this->get_field_id('animationLoop'); ?>"><?php _e('AnimationLoop:', 'geodirectory');?>
|
|
| 297 | + for="<?php echo $this->get_field_id('animationLoop'); ?>"><?php _e('AnimationLoop:', 'geodirectory'); ?>
|
|
| 298 | 298 | |
| 299 | 299 | <input type="checkbox" <?php if ($animationLoop) {
|
| 300 | 300 | echo 'checked="checked"'; |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | <p> |
| 308 | 308 | <label |
| 309 | - for="<?php echo $this->get_field_id('directionNav'); ?>"><?php _e('DirectionNav:', 'geodirectory');?>
|
|
| 309 | + for="<?php echo $this->get_field_id('directionNav'); ?>"><?php _e('DirectionNav:', 'geodirectory'); ?>
|
|
| 310 | 310 | |
| 311 | 311 | <input type="checkbox" <?php if ($directionNav) {
|
| 312 | 312 | echo 'checked="checked"'; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | <p> |
| 321 | 321 | <label |
| 322 | - for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e('Show Title:', 'geodirectory');?>
|
|
| 322 | + for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e('Show Title:', 'geodirectory'); ?>
|
|
| 323 | 323 | |
| 324 | 324 | <input type="checkbox" <?php if ($show_title) {
|
| 325 | 325 | echo 'checked="checked"'; |
@@ -353,10 +353,10 @@ discard block |
||
| 353 | 353 | |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - <?php if(is_active_widget( false, false, $this->id_base, true )){ ?>
|
|
| 356 | + <?php if (is_active_widget(false, false, $this->id_base, true)) { ?>
|
|
| 357 | 357 | var post_type = jQuery('#<?php echo $this->get_field_id('post_type'); ?>').val();
|
| 358 | 358 | |
| 359 | - geodir_change_category_list(post_type, '<?php echo $category;?>'); |
|
| 359 | + geodir_change_category_list(post_type, '<?php echo $category; ?>'); |
|
| 360 | 360 | <?php } ?> |
| 361 | 361 | |
| 362 | 362 | </script> |
@@ -332,7 +332,10 @@ |
||
| 332 | 332 | <label |
| 333 | 333 | for="<?php echo $this->get_field_id('show_featured_only'); ?>"><?php _e('Show only featured listings:', 'geodirectory'); ?>
|
| 334 | 334 | <input type="checkbox" id="<?php echo $this->get_field_id('show_featured_only'); ?>"
|
| 335 | - name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"'; ?>
|
|
| 335 | + name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) { |
|
| 336 | + echo 'checked="checked"'; |
|
| 337 | +} |
|
| 338 | +?> |
|
| 336 | 339 | value="1"/> |
| 337 | 340 | </label> |
| 338 | 341 | </p> |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | class geodir_popular_post_category extends WP_Widget |
| 16 | 16 | {
|
| 17 | 17 | /** |
| 18 | - * Register the popular post category widget. |
|
| 19 | - * |
|
| 20 | - * @since 1.0.0 |
|
| 18 | + * Register the popular post category widget. |
|
| 19 | + * |
|
| 20 | + * @since 1.0.0 |
|
| 21 | 21 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
| 22 | - */ |
|
| 22 | + */ |
|
| 23 | 23 | function __construct() {
|
| 24 | 24 | $widget_ops = array('classname' => 'geodir_popular_post_category', 'description' => __('GD > Popular Post Category', 'geodirectory'));
|
| 25 | 25 | parent::__construct( |
@@ -29,53 +29,53 @@ discard block |
||
| 29 | 29 | ); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Front-end display content for popular post category widget. |
|
| 34 | - * |
|
| 35 | - * @since 1.0.0 |
|
| 32 | + /** |
|
| 33 | + * Front-end display content for popular post category widget. |
|
| 34 | + * |
|
| 35 | + * @since 1.0.0 |
|
| 36 | 36 | * @since 1.5.1 Declare function public. |
| 37 | - * |
|
| 38 | - * @param array $args Widget arguments. |
|
| 39 | - * @param array $instance Saved values from database. |
|
| 40 | - */ |
|
| 41 | - public function widget($args, $instance) |
|
| 37 | + * |
|
| 38 | + * @param array $args Widget arguments. |
|
| 39 | + * @param array $instance Saved values from database. |
|
| 40 | + */ |
|
| 41 | + public function widget($args, $instance) |
|
| 42 | 42 | {
|
| 43 | 43 | geodir_popular_post_category_output($args, $instance); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Sanitize popular post category widget form values as they are saved. |
|
| 48 | - * |
|
| 49 | - * @since 1.0.0 |
|
| 46 | + /** |
|
| 47 | + * Sanitize popular post category widget form values as they are saved. |
|
| 48 | + * |
|
| 49 | + * @since 1.0.0 |
|
| 50 | 50 | * @since 1.5.1 Declare function public. |
| 51 | 51 | * @since 1.5.1 Added default_post_type parameter. |
| 52 | - * |
|
| 53 | - * @param array $new_instance Values just sent to be saved. |
|
| 54 | - * @param array $old_instance Previously saved values from database. |
|
| 55 | - * |
|
| 56 | - * @return array Updated safe values to be saved. |
|
| 57 | - */ |
|
| 58 | - public function update($new_instance, $old_instance) |
|
| 52 | + * |
|
| 53 | + * @param array $new_instance Values just sent to be saved. |
|
| 54 | + * @param array $old_instance Previously saved values from database. |
|
| 55 | + * |
|
| 56 | + * @return array Updated safe values to be saved. |
|
| 57 | + */ |
|
| 58 | + public function update($new_instance, $old_instance) |
|
| 59 | 59 | {
|
| 60 | 60 | //save the widget |
| 61 | 61 | $instance = $old_instance; |
| 62 | 62 | $instance['title'] = strip_tags($new_instance['title']); |
| 63 | 63 | $category_limit = (int)$new_instance['category_limit']; |
| 64 | 64 | $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15; |
| 65 | - $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : ''; |
|
| 65 | + $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : ''; |
|
| 66 | 66 | return $instance; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * Back-end popular post category widget settings form. |
|
| 71 | - * |
|
| 72 | - * @since 1.0.0 |
|
| 69 | + /** |
|
| 70 | + * Back-end popular post category widget settings form. |
|
| 71 | + * |
|
| 72 | + * @since 1.0.0 |
|
| 73 | 73 | * @since 1.5.1 Declare function public. |
| 74 | 74 | * @since 1.5.1 Added option to set default post type. |
| 75 | - * |
|
| 76 | - * @param array $instance Previously saved values from database. |
|
| 77 | - */ |
|
| 78 | - public function form($instance) |
|
| 75 | + * |
|
| 76 | + * @param array $instance Previously saved values from database. |
|
| 77 | + */ |
|
| 78 | + public function form($instance) |
|
| 79 | 79 | {
|
| 80 | 80 | //widgetform in backend |
| 81 | 81 | $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => ''));
|
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | $title = strip_tags($instance['title']); |
| 84 | 84 | $category_limit = (int)$instance['category_limit']; |
| 85 | 85 | $category_limit = $category_limit > 0 ? $category_limit : 15; |
| 86 | - $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : ''; |
|
| 86 | + $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : ''; |
|
| 87 | 87 | |
| 88 | - $post_type_options = geodir_get_posttypes('options');
|
|
| 88 | + $post_type_options = geodir_get_posttypes('options');
|
|
| 89 | 89 | ?> |
| 90 | 90 | <p> |
| 91 | 91 | <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
|
@@ -131,11 +131,11 @@ discard block |
||
| 131 | 131 | {
|
| 132 | 132 | |
| 133 | 133 | /** |
| 134 | - * Register the popular posts widget. |
|
| 135 | - * |
|
| 136 | - * @since 1.0.0 |
|
| 134 | + * Register the popular posts widget. |
|
| 135 | + * |
|
| 136 | + * @since 1.0.0 |
|
| 137 | 137 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
| 138 | - */ |
|
| 138 | + */ |
|
| 139 | 139 | function __construct() {
|
| 140 | 140 | $widget_ops = array('classname' => 'geodir_popular_post_view', 'description' => __('GD > Popular Post View', 'geodirectory'));
|
| 141 | 141 | parent::__construct( |
@@ -145,32 +145,32 @@ discard block |
||
| 145 | 145 | ); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - /** |
|
| 149 | - * Front-end display content for popular posts widget. |
|
| 150 | - * |
|
| 151 | - * @since 1.0.0 |
|
| 148 | + /** |
|
| 149 | + * Front-end display content for popular posts widget. |
|
| 150 | + * |
|
| 151 | + * @since 1.0.0 |
|
| 152 | 152 | * @since 1.5.1 Declare function public. |
| 153 | - * |
|
| 154 | - * @param array $args Widget arguments. |
|
| 155 | - * @param array $instance Saved values from database. |
|
| 156 | - */ |
|
| 157 | - public function widget($args, $instance) |
|
| 153 | + * |
|
| 154 | + * @param array $args Widget arguments. |
|
| 155 | + * @param array $instance Saved values from database. |
|
| 156 | + */ |
|
| 157 | + public function widget($args, $instance) |
|
| 158 | 158 | {
|
| 159 | 159 | geodir_popular_postview_output($args, $instance); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - /** |
|
| 163 | - * Sanitize popular posts widget form values as they are saved. |
|
| 164 | - * |
|
| 165 | - * @since 1.0.0 |
|
| 162 | + /** |
|
| 163 | + * Sanitize popular posts widget form values as they are saved. |
|
| 164 | + * |
|
| 165 | + * @since 1.0.0 |
|
| 166 | 166 | * @since 1.5.1 Declare function public. |
| 167 | - * |
|
| 168 | - * @param array $new_instance Values just sent to be saved. |
|
| 169 | - * @param array $old_instance Previously saved values from database. |
|
| 170 | - * |
|
| 171 | - * @return array Updated safe values to be saved. |
|
| 172 | - */ |
|
| 173 | - public function update($new_instance, $old_instance) |
|
| 167 | + * |
|
| 168 | + * @param array $new_instance Values just sent to be saved. |
|
| 169 | + * @param array $old_instance Previously saved values from database. |
|
| 170 | + * |
|
| 171 | + * @return array Updated safe values to be saved. |
|
| 172 | + */ |
|
| 173 | + public function update($new_instance, $old_instance) |
|
| 174 | 174 | {
|
| 175 | 175 | //save the widget |
| 176 | 176 | $instance = $old_instance; |
@@ -204,15 +204,15 @@ discard block |
||
| 204 | 204 | return $instance; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - /** |
|
| 208 | - * Back-end popular posts widget settings form. |
|
| 209 | - * |
|
| 210 | - * @since 1.0.0 |
|
| 207 | + /** |
|
| 208 | + * Back-end popular posts widget settings form. |
|
| 209 | + * |
|
| 210 | + * @since 1.0.0 |
|
| 211 | 211 | * @since 1.5.1 Declare function public. |
| 212 | - * |
|
| 213 | - * @param array $instance Previously saved values from database. |
|
| 214 | - */ |
|
| 215 | - public function form($instance) |
|
| 212 | + * |
|
| 213 | + * @param array $instance Previously saved values from database. |
|
| 214 | + */ |
|
| 215 | + public function form($instance) |
|
| 216 | 216 | {
|
| 217 | 217 | //widgetform in backend |
| 218 | 218 | $instance = wp_parse_args((array)$instance, |
@@ -282,14 +282,14 @@ discard block |
||
| 282 | 282 | for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
|
| 283 | 283 | |
| 284 | 284 | <?php $postypes = geodir_get_posttypes(); |
| 285 | - /** |
|
| 286 | - * Filter the post types to display in widget. |
|
| 287 | - * |
|
| 288 | - * @since 1.0.0 |
|
| 289 | - * |
|
| 290 | - * @param array $postypes Post types array. |
|
| 291 | - */ |
|
| 292 | - $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
|
|
| 285 | + /** |
|
| 286 | + * Filter the post types to display in widget. |
|
| 287 | + * |
|
| 288 | + * @since 1.0.0 |
|
| 289 | + * |
|
| 290 | + * @param array $postypes Post types array. |
|
| 291 | + */ |
|
| 292 | + $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
|
|
| 293 | 293 | |
| 294 | 294 | <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>"
|
| 295 | 295 | name="<?php echo $this->get_field_name('post_type'); ?>"
|
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | //save the widget |
| 61 | 61 | $instance = $old_instance; |
| 62 | 62 | $instance['title'] = strip_tags($new_instance['title']); |
| 63 | - $category_limit = (int)$new_instance['category_limit']; |
|
| 63 | + $category_limit = (int) $new_instance['category_limit']; |
|
| 64 | 64 | $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15; |
| 65 | 65 | $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : ''; |
| 66 | 66 | return $instance; |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | public function form($instance) |
| 79 | 79 | {
|
| 80 | 80 | //widgetform in backend |
| 81 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => ''));
|
|
| 81 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => ''));
|
|
| 82 | 82 | |
| 83 | 83 | $title = strip_tags($instance['title']); |
| 84 | - $category_limit = (int)$instance['category_limit']; |
|
| 84 | + $category_limit = (int) $instance['category_limit']; |
|
| 85 | 85 | $category_limit = $category_limit > 0 ? $category_limit : 15; |
| 86 | 86 | $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : ''; |
| 87 | 87 | |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | </p> |
| 97 | 97 | <p> |
| 98 | 98 | <label for="<?php echo $this->get_field_id('post_type'); ?>">
|
| 99 | - <?php _e('Default post type to use (if not set by page)', 'geodirectory');?>
|
|
| 99 | + <?php _e('Default post type to use (if not set by page)', 'geodirectory'); ?>
|
|
| 100 | 100 | <select class="widefat" id="<?php echo $this->get_field_id('default_post_type'); ?>" name="<?php echo $this->get_field_name('default_post_type'); ?>">
|
| 101 | 101 | <?php foreach ($post_type_options as $name => $title) { ?>
|
| 102 | - <option value="<?php echo $name;?>" <?php selected($name, $default_post_type);?>><?php echo $title; ?></option> |
|
| 102 | + <option value="<?php echo $name; ?>" <?php selected($name, $default_post_type); ?>><?php echo $title; ?></option> |
|
| 103 | 103 | <?php } ?> |
| 104 | 104 | </select> |
| 105 | 105 | </label> |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | for="<?php echo $this->get_field_id('category_limit'); ?>"><?php _e('Customize categories count to appear by default:', 'geodirectory'); ?>
|
| 110 | 110 | <input class="widefat" id="<?php echo $this->get_field_id('category_limit'); ?>"
|
| 111 | 111 | name="<?php echo $this->get_field_name('category_limit'); ?>" type="text"
|
| 112 | - value="<?php echo (int)esc_attr($category_limit); ?>"/> |
|
| 112 | + value="<?php echo (int) esc_attr($category_limit); ?>"/> |
|
| 113 | 113 | |
| 114 | 114 | <p class="description" |
| 115 | 115 | style="padding:0"><?php _e('After categories count reaches this limit option More Categories / Less Categoris will be displayed to show/hide categories. Default: 15', 'geodirectory'); ?></p>
|
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | public function form($instance) |
| 216 | 216 | {
|
| 217 | 217 | //widgetform in backend |
| 218 | - $instance = wp_parse_args((array)$instance, |
|
| 218 | + $instance = wp_parse_args((array) $instance, |
|
| 219 | 219 | array('title' => '',
|
| 220 | 220 | 'post_type' => '', |
| 221 | 221 | 'category' => array(), |
@@ -266,9 +266,9 @@ discard block |
||
| 266 | 266 | ?> |
| 267 | 267 | |
| 268 | 268 | <p> |
| 269 | - <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
|
|
| 269 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
|
|
| 270 | 270 | <small>(%posttype_singular_label% , |
| 271 | - %posttype_plural_label% <?php _e('can be used', 'geodirectory');?>)
|
|
| 271 | + %posttype_plural_label% <?php _e('can be used', 'geodirectory'); ?>)
|
|
| 272 | 272 | </small> |
| 273 | 273 | |
| 274 | 274 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | <p> |
| 281 | 281 | <label |
| 282 | - for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
|
|
| 282 | + for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?>
|
|
| 283 | 283 | |
| 284 | 284 | <?php $postypes = geodir_get_posttypes(); |
| 285 | 285 | /** |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | <p id="post_type_cats"> |
| 313 | 313 | <label |
| 314 | - for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory');?>
|
|
| 314 | + for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory'); ?>
|
|
| 315 | 315 | |
| 316 | 316 | <?php |
| 317 | 317 | |
@@ -350,14 +350,14 @@ discard block |
||
| 350 | 350 | |
| 351 | 351 | <input type="hidden" name="<?php echo $this->get_field_name('category_title'); ?>"
|
| 352 | 352 | id="<?php echo $this->get_field_id('category_title'); ?>"
|
| 353 | - value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory');?>"/>
|
|
| 353 | + value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory'); ?>"/>
|
|
| 354 | 354 | |
| 355 | 355 | </label> |
| 356 | 356 | </p> |
| 357 | 357 | |
| 358 | 358 | <p> |
| 359 | 359 | <label |
| 360 | - for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory');?>
|
|
| 360 | + for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory'); ?>
|
|
| 361 | 361 | |
| 362 | 362 | <select class="widefat" id="<?php echo $this->get_field_id('list_sort'); ?>"
|
| 363 | 363 | name="<?php echo $this->get_field_name('list_sort'); ?>">
|
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | <p> |
| 394 | 394 | |
| 395 | 395 | <label |
| 396 | - for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory');?>
|
|
| 396 | + for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?>
|
|
| 397 | 397 | |
| 398 | 398 | <input class="widefat" id="<?php echo $this->get_field_id('post_number'); ?>"
|
| 399 | 399 | name="<?php echo $this->get_field_name('post_number'); ?>" type="text"
|
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | <p> |
| 405 | 405 | <label for="<?php echo $this->get_field_id('layout'); ?>">
|
| 406 | - <?php _e('Layout:', 'geodirectory');?>
|
|
| 406 | + <?php _e('Layout:', 'geodirectory'); ?>
|
|
| 407 | 407 | <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>"
|
| 408 | 408 | name="<?php echo $this->get_field_name('layout'); ?>">
|
| 409 | 409 | <option <?php if ($layout == 'gridview_onehalf') {
|
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | <p> |
| 434 | 434 | <label |
| 435 | - for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory');?>
|
|
| 435 | + for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory'); ?>
|
|
| 436 | 436 | |
| 437 | 437 | <input class="widefat" id="<?php echo $this->get_field_id('listing_width'); ?>"
|
| 438 | 438 | name="<?php echo $this->get_field_name('listing_width'); ?>" type="text"
|
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | <p> |
| 444 | 444 | <label |
| 445 | - for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?>
|
|
| 445 | + for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?>
|
|
| 446 | 446 | <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>"
|
| 447 | 447 | name="<?php echo $this->get_field_name('character_count'); ?>" type="text"
|
| 448 | 448 | value="<?php echo esc_attr($character_count); ?>"/> |
@@ -451,41 +451,41 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | <p> |
| 453 | 453 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
|
| 454 | - <?php _e('Enable Location Filter:', 'geodirectory');?>
|
|
| 454 | + <?php _e('Enable Location Filter:', 'geodirectory'); ?>
|
|
| 455 | 455 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
|
| 456 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
|
|
| 456 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?>
|
|
| 457 | 457 | value="1"/> |
| 458 | 458 | </label> |
| 459 | 459 | </p> |
| 460 | 460 | <p> |
| 461 | 461 | <label for="<?php echo $this->get_field_id('show_featured_only'); ?>">
|
| 462 | - <?php _e('Show only featured listings:', 'geodirectory');?> <input type="checkbox"
|
|
| 462 | + <?php _e('Show only featured listings:', 'geodirectory'); ?> <input type="checkbox"
|
|
| 463 | 463 | id="<?php echo $this->get_field_id('show_featured_only'); ?>"
|
| 464 | - name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"';?>
|
|
| 464 | + name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"'; ?>
|
|
| 465 | 465 | value="1"/> |
| 466 | 466 | </label> |
| 467 | 467 | </p> |
| 468 | 468 | <p> |
| 469 | 469 | <label for="<?php echo $this->get_field_id('show_special_only'); ?>">
|
| 470 | - <?php _e('Show only listings with special offers:', 'geodirectory');?> <input type="checkbox"
|
|
| 470 | + <?php _e('Show only listings with special offers:', 'geodirectory'); ?> <input type="checkbox"
|
|
| 471 | 471 | id="<?php echo $this->get_field_id('show_special_only'); ?>"
|
| 472 | - name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"';?>
|
|
| 472 | + name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"'; ?>
|
|
| 473 | 473 | value="1"/> |
| 474 | 474 | </label> |
| 475 | 475 | </p> |
| 476 | 476 | <p> |
| 477 | 477 | <label for="<?php echo $this->get_field_id('with_pics_only'); ?>">
|
| 478 | - <?php _e('Show only listings with pics:', 'geodirectory');?> <input type="checkbox"
|
|
| 478 | + <?php _e('Show only listings with pics:', 'geodirectory'); ?> <input type="checkbox"
|
|
| 479 | 479 | id="<?php echo $this->get_field_id('with_pics_only'); ?>"
|
| 480 | - name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"';?>
|
|
| 480 | + name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"'; ?>
|
|
| 481 | 481 | value="1"/> |
| 482 | 482 | </label> |
| 483 | 483 | </p> |
| 484 | 484 | <p> |
| 485 | 485 | <label for="<?php echo $this->get_field_id('with_videos_only'); ?>">
|
| 486 | - <?php _e('Show only listings with videos:', 'geodirectory');?> <input type="checkbox"
|
|
| 486 | + <?php _e('Show only listings with videos:', 'geodirectory'); ?> <input type="checkbox"
|
|
| 487 | 487 | id="<?php echo $this->get_field_id('with_videos_only'); ?>"
|
| 488 | - name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"';?>
|
|
| 488 | + name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"'; ?>
|
|
| 489 | 489 | value="1"/> |
| 490 | 490 | </label> |
| 491 | 491 | </p> |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | - <?php if(is_active_widget( false, false, $this->id_base, true )){ ?>
|
|
| 534 | + <?php if (is_active_widget(false, false, $this->id_base, true)) { ?>
|
|
| 535 | 535 | var post_type = jQuery('#<?php echo $this->get_field_id('post_type'); ?>').val();
|
| 536 | 536 | |
| 537 | 537 | <?php } ?> |
@@ -190,10 +190,11 @@ discard block |
||
| 190 | 190 | $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
| 191 | 191 | $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
| 192 | 192 | $instance['character_count'] = $new_instance['character_count']; |
| 193 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 194 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 195 | - else |
|
| 196 | - $instance['add_location_filter'] = '0'; |
|
| 193 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') { |
|
| 194 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 195 | + } else { |
|
| 196 | + $instance['add_location_filter'] = '0'; |
|
| 197 | + } |
|
| 197 | 198 | |
| 198 | 199 | $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0; |
| 199 | 200 | $instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0; |
@@ -319,8 +320,9 @@ discard block |
||
| 319 | 320 | |
| 320 | 321 | $all_postypes = geodir_get_posttypes(); |
| 321 | 322 | |
| 322 | - if (!in_array($post_type, $all_postypes)) |
|
| 323 | - $post_type = 'gd_place'; |
|
| 323 | + if (!in_array($post_type, $all_postypes)) { |
|
| 324 | + $post_type = 'gd_place'; |
|
| 325 | + } |
|
| 324 | 326 | |
| 325 | 327 | $category_taxonomy = geodir_get_taxonomies($post_type); |
| 326 | 328 | $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
|
@@ -335,8 +337,9 @@ discard block |
||
| 335 | 337 | } ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
|
| 336 | 338 | <?php foreach ($categories as $category_obj) {
|
| 337 | 339 | $selected = ''; |
| 338 | - if (is_array($category) && in_array($category_obj->term_id, $category)) |
|
| 339 | - echo $selected = 'selected="selected"'; |
|
| 340 | + if (is_array($category) && in_array($category_obj->term_id, $category)) { |
|
| 341 | + echo $selected = 'selected="selected"'; |
|
| 342 | + } |
|
| 340 | 343 | |
| 341 | 344 | ?> |
| 342 | 345 | |
@@ -350,7 +353,12 @@ discard block |
||
| 350 | 353 | |
| 351 | 354 | <input type="hidden" name="<?php echo $this->get_field_name('category_title'); ?>"
|
| 352 | 355 | id="<?php echo $this->get_field_id('category_title'); ?>"
|
| 353 | - value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory');?>"/>
|
|
| 356 | + value="<?php if ($category_title != '') { |
|
| 357 | + echo $category_title; |
|
| 358 | +} else { |
|
| 359 | + echo __('All', 'geodirectory'); |
|
| 360 | +} |
|
| 361 | +?>"/> |
|
| 354 | 362 | |
| 355 | 363 | </label> |
| 356 | 364 | </p> |
@@ -453,7 +461,10 @@ discard block |
||
| 453 | 461 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
|
| 454 | 462 | <?php _e('Enable Location Filter:', 'geodirectory');?>
|
| 455 | 463 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
|
| 456 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
|
|
| 464 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) { |
|
| 465 | + echo 'checked="checked"'; |
|
| 466 | +} |
|
| 467 | +?> |
|
| 457 | 468 | value="1"/> |
| 458 | 469 | </label> |
| 459 | 470 | </p> |
@@ -461,7 +472,10 @@ discard block |
||
| 461 | 472 | <label for="<?php echo $this->get_field_id('show_featured_only'); ?>">
|
| 462 | 473 | <?php _e('Show only featured listings:', 'geodirectory');?> <input type="checkbox"
|
| 463 | 474 | id="<?php echo $this->get_field_id('show_featured_only'); ?>"
|
| 464 | - name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"';?>
|
|
| 475 | + name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) { |
|
| 476 | + echo 'checked="checked"'; |
|
| 477 | +} |
|
| 478 | +?> |
|
| 465 | 479 | value="1"/> |
| 466 | 480 | </label> |
| 467 | 481 | </p> |
@@ -469,7 +483,10 @@ discard block |
||
| 469 | 483 | <label for="<?php echo $this->get_field_id('show_special_only'); ?>">
|
| 470 | 484 | <?php _e('Show only listings with special offers:', 'geodirectory');?> <input type="checkbox"
|
| 471 | 485 | id="<?php echo $this->get_field_id('show_special_only'); ?>"
|
| 472 | - name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"';?>
|
|
| 486 | + name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) { |
|
| 487 | + echo 'checked="checked"'; |
|
| 488 | +} |
|
| 489 | +?> |
|
| 473 | 490 | value="1"/> |
| 474 | 491 | </label> |
| 475 | 492 | </p> |
@@ -477,7 +494,10 @@ discard block |
||
| 477 | 494 | <label for="<?php echo $this->get_field_id('with_pics_only'); ?>">
|
| 478 | 495 | <?php _e('Show only listings with pics:', 'geodirectory');?> <input type="checkbox"
|
| 479 | 496 | id="<?php echo $this->get_field_id('with_pics_only'); ?>"
|
| 480 | - name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"';?>
|
|
| 497 | + name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) { |
|
| 498 | + echo 'checked="checked"'; |
|
| 499 | +} |
|
| 500 | +?> |
|
| 481 | 501 | value="1"/> |
| 482 | 502 | </label> |
| 483 | 503 | </p> |
@@ -485,7 +505,10 @@ discard block |
||
| 485 | 505 | <label for="<?php echo $this->get_field_id('with_videos_only'); ?>">
|
| 486 | 506 | <?php _e('Show only listings with videos:', 'geodirectory');?> <input type="checkbox"
|
| 487 | 507 | id="<?php echo $this->get_field_id('with_videos_only'); ?>"
|
| 488 | - name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"';?>
|
|
| 508 | + name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) { |
|
| 509 | + echo 'checked="checked"'; |
|
| 510 | +} |
|
| 511 | +?> |
|
| 489 | 512 | value="1"/> |
| 490 | 513 | </label> |
| 491 | 514 | </p> |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | class geodir_related_listing_postview extends WP_Widget |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * Register the related listing widget. |
|
| 19 | - * |
|
| 20 | - * @since 1.0.0 |
|
| 18 | + * Register the related listing widget. |
|
| 19 | + * |
|
| 20 | + * @since 1.0.0 |
|
| 21 | 21 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
| 22 | - */ |
|
| 22 | + */ |
|
| 23 | 23 | function __construct() { |
| 24 | 24 | $widget_ops = array('classname' => 'geodir_related_listing_post_view', 'description' => __('GD > Related Listing', 'geodirectory')); |
| 25 | 25 | parent::__construct( |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | ); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Front-end display content for related listing widget. |
|
| 34 | - * |
|
| 35 | - * @since 1.0.0 |
|
| 32 | + /** |
|
| 33 | + * Front-end display content for related listing widget. |
|
| 34 | + * |
|
| 35 | + * @since 1.0.0 |
|
| 36 | 36 | * @since 1.5.1 Declare function public. |
| 37 | - * |
|
| 38 | - * @param array $args Widget arguments. |
|
| 39 | - * @param array $instance Saved values from database. |
|
| 40 | - */ |
|
| 37 | + * |
|
| 38 | + * @param array $args Widget arguments. |
|
| 39 | + * @param array $instance Saved values from database. |
|
| 40 | + */ |
|
| 41 | 41 | public function widget($args, $instance) |
| 42 | 42 | { |
| 43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $title = empty($instance['title']) ? __('Related Listing', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
| 49 | 49 | |
| 50 | 50 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
| 51 | - $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']); |
|
| 51 | + $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']); |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Filter the relation type to get related listing. |
@@ -56,22 +56,22 @@ discard block |
||
| 56 | 56 | * @since 1.0.0 |
| 57 | 57 | * @param string $instance['relate_to'] Can be tags or category. |
| 58 | 58 | */ |
| 59 | - $relate_to = empty($instance['relate_to']) ? 'category' : apply_filters('widget_relate_to', $instance['relate_to']); |
|
| 59 | + $relate_to = empty($instance['relate_to']) ? 'category' : apply_filters('widget_relate_to', $instance['relate_to']); |
|
| 60 | 60 | |
| 61 | 61 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
| 62 | - $layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']); |
|
| 62 | + $layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']); |
|
| 63 | 63 | |
| 64 | 64 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
| 65 | - $add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']); |
|
| 65 | + $add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']); |
|
| 66 | 66 | |
| 67 | 67 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
| 68 | - $listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']); |
|
| 68 | + $listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']); |
|
| 69 | 69 | |
| 70 | 70 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
| 71 | - $list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']); |
|
| 71 | + $list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']); |
|
| 72 | 72 | |
| 73 | 73 | /** This filter is documented in geodirectory-functions/general_functions.php */ |
| 74 | - $character_count = empty($instance['character_count']) ? 20 : apply_filters('widget_list_character_count', $instance['character_count']); |
|
| 74 | + $character_count = empty($instance['character_count']) ? 20 : apply_filters('widget_list_character_count', $instance['character_count']); |
|
| 75 | 75 | |
| 76 | 76 | $arr = array( |
| 77 | 77 | 'before_title' => $before_title, |
@@ -95,17 +95,17 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * Sanitize related listing widget form values as they are saved. |
|
| 100 | - * |
|
| 101 | - * @since 1.0.0 |
|
| 98 | + /** |
|
| 99 | + * Sanitize related listing widget form values as they are saved. |
|
| 100 | + * |
|
| 101 | + * @since 1.0.0 |
|
| 102 | 102 | * @since 1.5.1 Declare function public. |
| 103 | - * |
|
| 104 | - * @param array $new_instance Values just sent to be saved. |
|
| 105 | - * @param array $old_instance Previously saved values from database. |
|
| 106 | - * |
|
| 107 | - * @return array Updated safe values to be saved. |
|
| 108 | - */ |
|
| 103 | + * |
|
| 104 | + * @param array $new_instance Values just sent to be saved. |
|
| 105 | + * @param array $old_instance Previously saved values from database. |
|
| 106 | + * |
|
| 107 | + * @return array Updated safe values to be saved. |
|
| 108 | + */ |
|
| 109 | 109 | public function update($new_instance, $old_instance) |
| 110 | 110 | { |
| 111 | 111 | //save the widget |
@@ -126,14 +126,14 @@ discard block |
||
| 126 | 126 | return $instance; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - /** |
|
| 130 | - * Back-end related listing widget settings form. |
|
| 131 | - * |
|
| 132 | - * @since 1.0.0 |
|
| 129 | + /** |
|
| 130 | + * Back-end related listing widget settings form. |
|
| 131 | + * |
|
| 132 | + * @since 1.0.0 |
|
| 133 | 133 | * @since 1.5.1 Declare function public. |
| 134 | - * |
|
| 135 | - * @param array $instance Previously saved values from database. |
|
| 136 | - */ |
|
| 134 | + * |
|
| 135 | + * @param array $instance Previously saved values from database. |
|
| 136 | + */ |
|
| 137 | 137 | public function form($instance) |
| 138 | 138 | { |
| 139 | 139 | //widgetform in backend |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | public function form($instance) |
| 138 | 138 | { |
| 139 | 139 | //widgetform in backend |
| 140 | - $instance = wp_parse_args((array)$instance, |
|
| 140 | + $instance = wp_parse_args((array) $instance, |
|
| 141 | 141 | array('title' => '', |
| 142 | 142 | 'list_sort' => '', |
| 143 | 143 | 'list_order' => '', |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | ?> |
| 171 | 171 | <p> |
| 172 | - <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?> |
|
| 172 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?> |
|
| 173 | 173 | |
| 174 | 174 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" |
| 175 | 175 | name="<?php echo $this->get_field_name('title'); ?>" type="text" |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | </p> |
| 179 | 179 | <p> |
| 180 | 180 | <label |
| 181 | - for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory');?> |
|
| 181 | + for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory'); ?> |
|
| 182 | 182 | |
| 183 | 183 | <select class="widefat" id="<?php echo $this->get_field_id('list_sort'); ?>" |
| 184 | 184 | name="<?php echo $this->get_field_name('list_sort'); ?>"> |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | </p> |
| 209 | 209 | <p> |
| 210 | 210 | <label |
| 211 | - for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory');?> |
|
| 211 | + for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?> |
|
| 212 | 212 | |
| 213 | 213 | <input class="widefat" id="<?php echo $this->get_field_id('post_number'); ?>" |
| 214 | 214 | name="<?php echo $this->get_field_name('post_number'); ?>" type="text" |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | </p> |
| 218 | 218 | <p> |
| 219 | 219 | <label for="<?php echo $this->get_field_id('relate_to'); ?>"> |
| 220 | - <?php _e('Relate to:', 'geodirectory');?> |
|
| 220 | + <?php _e('Relate to:', 'geodirectory'); ?> |
|
| 221 | 221 | <select class="widefat" id="<?php echo $this->get_field_id('relate_to'); ?>" |
| 222 | 222 | name="<?php echo $this->get_field_name('relate_to'); ?>"> |
| 223 | 223 | <option <?php if ($relate_to == 'category') { |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | <p> |
| 233 | 233 | <p> |
| 234 | 234 | <label for="<?php echo $this->get_field_id('layout'); ?>"> |
| 235 | - <?php _e('Layout:', 'geodirectory');?> |
|
| 235 | + <?php _e('Layout:', 'geodirectory'); ?> |
|
| 236 | 236 | <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>" |
| 237 | 237 | name="<?php echo $this->get_field_name('layout'); ?>"> |
| 238 | 238 | <option <?php if ($layout == 'gridview_onehalf') { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | </p> |
| 261 | 261 | <p> |
| 262 | 262 | <label |
| 263 | - for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory');?> |
|
| 263 | + for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory'); ?> |
|
| 264 | 264 | |
| 265 | 265 | <input class="widefat" id="<?php echo $this->get_field_id('listing_width'); ?>" |
| 266 | 266 | name="<?php echo $this->get_field_name('listing_width'); ?>" type="text" |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | </p> |
| 270 | 270 | <p> |
| 271 | 271 | <label |
| 272 | - for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?> |
|
| 272 | + for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?> |
|
| 273 | 273 | <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>" |
| 274 | 274 | name="<?php echo $this->get_field_name('character_count'); ?>" type="text" |
| 275 | 275 | value="<?php echo esc_attr($character_count); ?>"/> |
@@ -277,9 +277,9 @@ discard block |
||
| 277 | 277 | </p> |
| 278 | 278 | <p> |
| 279 | 279 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
| 280 | - <?php _e('Enable Location Filter:', 'geodirectory');?> |
|
| 280 | + <?php _e('Enable Location Filter:', 'geodirectory'); ?> |
|
| 281 | 281 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
| 282 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
| 282 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?> |
|
| 283 | 283 | value="1"/> |
| 284 | 284 | </label> |
| 285 | 285 | </p> |
@@ -118,10 +118,11 @@ discard block |
||
| 118 | 118 | $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
| 119 | 119 | $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
| 120 | 120 | $instance['character_count'] = $new_instance['character_count']; |
| 121 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 122 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 123 | - else |
|
| 124 | - $instance['add_location_filter'] = '0'; |
|
| 121 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') { |
|
| 122 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 123 | + } else { |
|
| 124 | + $instance['add_location_filter'] = '0'; |
|
| 125 | + } |
|
| 125 | 126 | |
| 126 | 127 | return $instance; |
| 127 | 128 | } |
@@ -279,7 +280,10 @@ discard block |
||
| 279 | 280 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>"> |
| 280 | 281 | <?php _e('Enable Location Filter:', 'geodirectory');?> |
| 281 | 282 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>" |
| 282 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?> |
|
| 283 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) { |
|
| 284 | + echo 'checked="checked"'; |
|
| 285 | +} |
|
| 286 | +?> |
|
| 283 | 287 | value="1"/> |
| 284 | 288 | </label> |
| 285 | 289 | </p> |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | class geodir_recent_reviews_widget extends WP_Widget |
| 16 | 16 | {
|
| 17 | 17 | /** |
| 18 | - * Register the recent reviews widget. |
|
| 19 | - * |
|
| 20 | - * @since 1.0.0 |
|
| 18 | + * Register the recent reviews widget. |
|
| 19 | + * |
|
| 20 | + * @since 1.0.0 |
|
| 21 | 21 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
| 22 | - */ |
|
| 22 | + */ |
|
| 23 | 23 | function __construct() {
|
| 24 | 24 | $widget_ops = array('classname' => 'geodir_recent_reviews', 'description' => __('GD > Recent Reviews', 'geodirectory'));
|
| 25 | 25 | parent::__construct( |
@@ -29,16 +29,16 @@ discard block |
||
| 29 | 29 | ); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Front-end display content for recent reviews widget. |
|
| 34 | - * |
|
| 35 | - * @since 1.0.0 |
|
| 32 | + /** |
|
| 33 | + * Front-end display content for recent reviews widget. |
|
| 34 | + * |
|
| 35 | + * @since 1.0.0 |
|
| 36 | 36 | * @since 1.5.1 Declare function public. |
| 37 | - * |
|
| 38 | - * @param array $args Widget arguments. |
|
| 39 | - * @param array $instance Saved values from database. |
|
| 40 | - */ |
|
| 41 | - public function widget($args, $instance) |
|
| 37 | + * |
|
| 38 | + * @param array $args Widget arguments. |
|
| 39 | + * @param array $instance Saved values from database. |
|
| 40 | + */ |
|
| 41 | + public function widget($args, $instance) |
|
| 42 | 42 | {
|
| 43 | 43 | // prints the widget |
| 44 | 44 | extract($args, EXTR_SKIP); |
@@ -46,23 +46,23 @@ discard block |
||
| 46 | 46 | /** This filter is documented in geodirectory_widgets.php */ |
| 47 | 47 | $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * Filter the number of reviews to display. |
|
| 51 | - * |
|
| 52 | - * @since 1.0.0 |
|
| 53 | - * |
|
| 54 | - * @param int $instance['count'] Number of reviews to display. |
|
| 55 | - */ |
|
| 56 | - $count = empty($instance['count']) ? '5' : apply_filters('widget_count', $instance['count']);
|
|
| 49 | + /** |
|
| 50 | + * Filter the number of reviews to display. |
|
| 51 | + * |
|
| 52 | + * @since 1.0.0 |
|
| 53 | + * |
|
| 54 | + * @param int $instance['count'] Number of reviews to display. |
|
| 55 | + */ |
|
| 56 | + $count = empty($instance['count']) ? '5' : apply_filters('widget_count', $instance['count']);
|
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * Filter the height and width of the avatar image in pixels. |
|
| 60 | - * |
|
| 61 | - * @since 1.0.0 |
|
| 62 | - * |
|
| 63 | - * @param int $g_size Height and width of the avatar image in pixels. Default 30. |
|
| 64 | - */ |
|
| 65 | - $g_size = apply_filters('geodir_recent_reviews_g_size', 30);
|
|
| 58 | + /** |
|
| 59 | + * Filter the height and width of the avatar image in pixels. |
|
| 60 | + * |
|
| 61 | + * @since 1.0.0 |
|
| 62 | + * |
|
| 63 | + * @param int $g_size Height and width of the avatar image in pixels. Default 30. |
|
| 64 | + */ |
|
| 65 | + $g_size = apply_filters('geodir_recent_reviews_g_size', 30);
|
|
| 66 | 66 | /** |
| 67 | 67 | * Filter the excerpt length |
| 68 | 68 | * |
@@ -87,18 +87,18 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - /** |
|
| 91 | - * Sanitize recent reviews widget form values as they are saved. |
|
| 92 | - * |
|
| 93 | - * @since 1.0.0 |
|
| 90 | + /** |
|
| 91 | + * Sanitize recent reviews widget form values as they are saved. |
|
| 92 | + * |
|
| 93 | + * @since 1.0.0 |
|
| 94 | 94 | * @since 1.5.1 Declare function public. |
| 95 | - * |
|
| 96 | - * @param array $new_instance Values just sent to be saved. |
|
| 97 | - * @param array $old_instance Previously saved values from database. |
|
| 98 | - * |
|
| 99 | - * @return array Updated safe values to be saved. |
|
| 100 | - */ |
|
| 101 | - public function update($new_instance, $old_instance) |
|
| 95 | + * |
|
| 96 | + * @param array $new_instance Values just sent to be saved. |
|
| 97 | + * @param array $old_instance Previously saved values from database. |
|
| 98 | + * |
|
| 99 | + * @return array Updated safe values to be saved. |
|
| 100 | + */ |
|
| 101 | + public function update($new_instance, $old_instance) |
|
| 102 | 102 | {
|
| 103 | 103 | //save the widget |
| 104 | 104 | $instance = $old_instance; |
@@ -107,15 +107,15 @@ discard block |
||
| 107 | 107 | return $instance; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - /** |
|
| 111 | - * Back-end recent reviews widget settings form. |
|
| 112 | - * |
|
| 113 | - * @since 1.0.0 |
|
| 110 | + /** |
|
| 111 | + * Back-end recent reviews widget settings form. |
|
| 112 | + * |
|
| 113 | + * @since 1.0.0 |
|
| 114 | 114 | * @since 1.5.1 Declare function public. |
| 115 | - * |
|
| 116 | - * @param array $instance Previously saved values from database. |
|
| 117 | - */ |
|
| 118 | - public function form($instance) |
|
| 115 | + * |
|
| 116 | + * @param array $instance Previously saved values from database. |
|
| 117 | + */ |
|
| 118 | + public function form($instance) |
|
| 119 | 119 | {
|
| 120 | 120 | //widgetform in backend |
| 121 | 121 | $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | public function form($instance) |
| 119 | 119 | {
|
| 120 | 120 | //widgetform in backend |
| 121 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
|
| 121 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'count' => ''));
|
|
| 122 | 122 | $title = strip_tags($instance['title']); |
| 123 | 123 | $count = strip_tags($instance['count']); |
| 124 | 124 | ?> |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | class geodir_homepage_map extends WP_Widget |
| 18 | 18 | {
|
| 19 | 19 | /** |
| 20 | - * Register the home page map widget. |
|
| 21 | - * |
|
| 22 | - * @since 1.0.0 |
|
| 20 | + * Register the home page map widget. |
|
| 21 | + * |
|
| 22 | + * @since 1.0.0 |
|
| 23 | 23 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
| 24 | - */ |
|
| 24 | + */ |
|
| 25 | 25 | function __construct() {
|
| 26 | 26 | $widget_ops = array('classname' => 'widget Google Map in Home page', 'description' => __('Google Map in Home page. It will show you google map V3 for Home page with category checkbox selection.', 'geodirectory'));
|
| 27 | 27 | parent::__construct( |
@@ -31,15 +31,15 @@ discard block |
||
| 31 | 31 | ); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Front-end display content for home page map widget. |
|
| 36 | - * |
|
| 37 | - * @since 1.0.0 |
|
| 34 | + /** |
|
| 35 | + * Front-end display content for home page map widget. |
|
| 36 | + * |
|
| 37 | + * @since 1.0.0 |
|
| 38 | 38 | * @since 1.5.1 Declare function public. |
| 39 | - * |
|
| 40 | - * @param array $args Widget arguments. |
|
| 41 | - * @param array $instance Saved values from database. |
|
| 42 | - */ |
|
| 39 | + * |
|
| 40 | + * @param array $args Widget arguments. |
|
| 41 | + * @param array $instance Saved values from database. |
|
| 42 | + */ |
|
| 43 | 43 | public function widget($args, $instance) |
| 44 | 44 | {
|
| 45 | 45 | extract($args, EXTR_SKIP); |
@@ -90,17 +90,17 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - /** |
|
| 94 | - * Sanitize home page map widget form values as they are saved. |
|
| 95 | - * |
|
| 96 | - * @since 1.0.0 |
|
| 93 | + /** |
|
| 94 | + * Sanitize home page map widget form values as they are saved. |
|
| 95 | + * |
|
| 96 | + * @since 1.0.0 |
|
| 97 | 97 | * @since 1.5.1 Declare function public. |
| 98 | - * |
|
| 99 | - * @param array $new_instance Values just sent to be saved. |
|
| 100 | - * @param array $old_instance Previously saved values from database. |
|
| 101 | - * |
|
| 102 | - * @return array Updated safe values to be saved. |
|
| 103 | - */ |
|
| 98 | + * |
|
| 99 | + * @param array $new_instance Values just sent to be saved. |
|
| 100 | + * @param array $old_instance Previously saved values from database. |
|
| 101 | + * |
|
| 102 | + * @return array Updated safe values to be saved. |
|
| 103 | + */ |
|
| 104 | 104 | public function update($new_instance, $old_instance) |
| 105 | 105 | {
|
| 106 | 106 | //save the widget |
@@ -116,14 +116,14 @@ discard block |
||
| 116 | 116 | return $instance; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * Back-end home page map widget settings form. |
|
| 121 | - * |
|
| 122 | - * @since 1.0.0 |
|
| 119 | + /** |
|
| 120 | + * Back-end home page map widget settings form. |
|
| 121 | + * |
|
| 122 | + * @since 1.0.0 |
|
| 123 | 123 | * @since 1.5.1 Declare function public. |
| 124 | - * |
|
| 125 | - * @param array $instance Previously saved values from database. |
|
| 126 | - */ |
|
| 124 | + * |
|
| 125 | + * @param array $instance Previously saved values from database. |
|
| 126 | + */ |
|
| 127 | 127 | public function form($instance) |
| 128 | 128 | {
|
| 129 | 129 | //widgetform in backend |
@@ -238,11 +238,11 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /** |
| 241 | - * Adds the javascript in the footer for home page map widget. |
|
| 242 | - * |
|
| 243 | - * @since 1.0.0 |
|
| 241 | + * Adds the javascript in the footer for home page map widget. |
|
| 242 | + * |
|
| 243 | + * @since 1.0.0 |
|
| 244 | 244 | * @since 1.5.1 Declare function public. |
| 245 | - */ |
|
| 245 | + */ |
|
| 246 | 246 | public function geodir_home_map_add_script() |
| 247 | 247 | {
|
| 248 | 248 | ?> |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | {
|
| 129 | 129 | //widgetform in backend |
| 130 | 130 | |
| 131 | - $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'child_collapse' => '0', 'scrollwheel' => '0'));
|
|
| 131 | + $instance = wp_parse_args((array) $instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'child_collapse' => '0', 'scrollwheel' => '0'));
|
|
| 132 | 132 | $width = strip_tags($instance['width']); |
| 133 | 133 | $heigh = strip_tags($instance['heigh']); |
| 134 | 134 | $maptype = strip_tags($instance['maptype']); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | <option <?php if (isset($maptype) && $maptype == 'HYBRID') {
|
| 174 | 174 | echo 'selected="selected"'; |
| 175 | 175 | } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
|
| 176 | - <option <?php selected($maptype, 'TERRAIN');?> |
|
| 176 | + <option <?php selected($maptype, 'TERRAIN'); ?> |
|
| 177 | 177 | value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option>
|
| 178 | 178 | </select> |
| 179 | 179 | </label> |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | : |
| 221 | 221 | <input id="<?php echo $this->get_field_id('child_collapse'); ?>"
|
| 222 | 222 | name="<?php echo $this->get_field_name('child_collapse'); ?>" type="checkbox" value="1"
|
| 223 | - <?php if ($child_collapse){ ?>checked="checked" <?php } ?> />
|
|
| 223 | + <?php if ($child_collapse) { ?>checked="checked" <?php } ?> />
|
|
| 224 | 224 | </label> |
| 225 | 225 | </p> |
| 226 | 226 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | : |
| 231 | 231 | <input id="<?php echo $this->get_field_id('scrollwheel'); ?>"
|
| 232 | 232 | name="<?php echo $this->get_field_name('scrollwheel'); ?>" type="checkbox" value="1"
|
| 233 | - <?php if ($scrollwheel){ ?>checked="checked" <?php } ?> />
|
|
| 233 | + <?php if ($scrollwheel) { ?>checked="checked" <?php } ?> />
|
|
| 234 | 234 | </label> |
| 235 | 235 | </p> |
| 236 | 236 | |
@@ -192,8 +192,9 @@ |
||
| 192 | 192 | |
| 193 | 193 | foreach ($map_zoom_level as $level) {
|
| 194 | 194 | $selected = ''; |
| 195 | - if ($level == $zoom) |
|
| 196 | - $selected = 'selected="selected"'; |
|
| 195 | + if ($level == $zoom) { |
|
| 196 | + $selected = 'selected="selected"'; |
|
| 197 | + } |
|
| 197 | 198 | |
| 198 | 199 | echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>'; |
| 199 | 200 | |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | {
|
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | - * Register the listing page map widget. |
|
| 94 | - * |
|
| 95 | - * @since 1.0.0 |
|
| 93 | + * Register the listing page map widget. |
|
| 94 | + * |
|
| 95 | + * @since 1.0.0 |
|
| 96 | 96 | * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
| 97 | - */ |
|
| 97 | + */ |
|
| 98 | 98 | function __construct() {
|
| 99 | 99 | $widget_ops = array('classname' => 'widget geodir-map-listing-page', 'description' => __('Google Map for Listing page. It will show you google map V3 for Listing page.', 'geodirectory'));
|
| 100 | 100 | parent::__construct( |
@@ -110,17 +110,17 @@ discard block |
||
| 110 | 110 | add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Front-end display content for listing page map widget. |
|
| 115 | - * |
|
| 116 | - * @since 1.0.0 |
|
| 113 | + /** |
|
| 114 | + * Front-end display content for listing page map widget. |
|
| 115 | + * |
|
| 116 | + * @since 1.0.0 |
|
| 117 | 117 | * @since 1.5.1 Declare function public. |
| 118 | - * |
|
| 118 | + * |
|
| 119 | 119 | * @global object $post The current post object. |
| 120 | 120 | * |
| 121 | - * @param array $args Widget arguments. |
|
| 122 | - * @param array $instance Saved values from database. |
|
| 123 | - */ |
|
| 121 | + * @param array $args Widget arguments. |
|
| 122 | + * @param array $instance Saved values from database. |
|
| 123 | + */ |
|
| 124 | 124 | public function widget($args, $instance) |
| 125 | 125 | {
|
| 126 | 126 | |
@@ -150,17 +150,17 @@ discard block |
||
| 150 | 150 | $scrollwheel = empty($instance['scrollwheel']) ? '0' : apply_filters('widget_scrollwheel', $instance['scrollwheel']);
|
| 151 | 151 | $showall = empty($instance['showall']) ? '0' : apply_filters('widget_showall', $instance['showall']);
|
| 152 | 152 | |
| 153 | - /** |
|
| 153 | + /** |
|
| 154 | 154 | * Filter the listing map should to be displayed or not. |
| 155 | 155 | * |
| 156 | 156 | * @since 1.4.6 |
| 157 | - * |
|
| 157 | + * |
|
| 158 | 158 | * @param bool $display true if map should be displayed, false if not. |
| 159 | 159 | */ |
| 160 | - $show_map = apply_filters( 'geodir_show_map_listing', $display = true ); |
|
| 161 | - if ( !$show_map ) {
|
|
| 162 | - return; |
|
| 163 | - } |
|
| 160 | + $show_map = apply_filters( 'geodir_show_map_listing', $display = true ); |
|
| 161 | + if ( !$show_map ) {
|
|
| 162 | + return; |
|
| 163 | + } |
|
| 164 | 164 | |
| 165 | 165 | $map_args = array(); |
| 166 | 166 | $map_args['map_canvas_name'] = str_replace('-', '_', $args['widget_id']);
|
@@ -219,17 +219,17 @@ discard block |
||
| 219 | 219 | endif; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - /** |
|
| 223 | - * Sanitize listing page map widget form values as they are saved. |
|
| 224 | - * |
|
| 225 | - * @since 1.0.0 |
|
| 222 | + /** |
|
| 223 | + * Sanitize listing page map widget form values as they are saved. |
|
| 224 | + * |
|
| 225 | + * @since 1.0.0 |
|
| 226 | 226 | * @since 1.5.1 Declare function public. |
| 227 | - * |
|
| 228 | - * @param array $new_instance Values just sent to be saved. |
|
| 229 | - * @param array $old_instance Previously saved values from database. |
|
| 230 | - * |
|
| 231 | - * @return array Updated safe values to be saved. |
|
| 232 | - */ |
|
| 227 | + * |
|
| 228 | + * @param array $new_instance Values just sent to be saved. |
|
| 229 | + * @param array $old_instance Previously saved values from database. |
|
| 230 | + * |
|
| 231 | + * @return array Updated safe values to be saved. |
|
| 232 | + */ |
|
| 233 | 233 | public function update($new_instance, $old_instance) |
| 234 | 234 | {
|
| 235 | 235 | //save the widget |
@@ -246,14 +246,14 @@ discard block |
||
| 246 | 246 | return $instance; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - /** |
|
| 250 | - * Back-end listing page map widget settings form. |
|
| 251 | - * |
|
| 252 | - * @since 1.0.0 |
|
| 249 | + /** |
|
| 250 | + * Back-end listing page map widget settings form. |
|
| 251 | + * |
|
| 252 | + * @since 1.0.0 |
|
| 253 | 253 | * @since 1.5.1 Declare function public. |
| 254 | - * |
|
| 255 | - * @param array $instance Previously saved values from database. |
|
| 256 | - */ |
|
| 254 | + * |
|
| 255 | + * @param array $instance Previously saved values from database. |
|
| 256 | + */ |
|
| 257 | 257 | public function form($instance) |
| 258 | 258 | {
|
| 259 | 259 | //widgetform in backend |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * @param string $post->marker_json JSON representation of the post marker info. |
| 46 | 46 | * @param object $post The post object. |
| 47 | 47 | */ |
| 48 | - $list_map_json[] = apply_filters('geodir_create_list_jsondata',$post->marker_json,$post);
|
|
| 48 | + $list_map_json[] = apply_filters('geodir_create_list_jsondata', $post->marker_json, $post);
|
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | } |
@@ -157,8 +157,8 @@ discard block |
||
| 157 | 157 | * |
| 158 | 158 | * @param bool $display true if map should be displayed, false if not. |
| 159 | 159 | */ |
| 160 | - $show_map = apply_filters( 'geodir_show_map_listing', $display = true ); |
|
| 161 | - if ( !$show_map ) {
|
|
| 160 | + $show_map = apply_filters('geodir_show_map_listing', $display = true);
|
|
| 161 | + if (!$show_map) {
|
|
| 162 | 162 | return; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | public function form($instance) |
| 258 | 258 | {
|
| 259 | 259 | //widgetform in backend |
| 260 | - $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0'));
|
|
| 260 | + $instance = wp_parse_args((array) $instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0'));
|
|
| 261 | 261 | $width = strip_tags($instance['width']); |
| 262 | 262 | $heigh = strip_tags($instance['heigh']); |
| 263 | 263 | $maptype = strip_tags($instance['maptype']); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | <option <?php if (isset($maptype) && $maptype == 'HYBRID') {
|
| 304 | 304 | echo 'selected="selected"'; |
| 305 | 305 | } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
|
| 306 | - <option <?php selected($maptype, 'TERRAIN');?> |
|
| 306 | + <option <?php selected($maptype, 'TERRAIN'); ?> |
|
| 307 | 307 | value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option>
|
| 308 | 308 | </select> |
| 309 | 309 | </label> |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | : |
| 362 | 362 | <input id="<?php echo $this->get_field_id('scrollwheel'); ?>"
|
| 363 | 363 | name="<?php echo $this->get_field_name('scrollwheel'); ?>" type="checkbox" value="1"
|
| 364 | - <?php if ($scrollwheel){ ?>checked="checked" <?php } ?> />
|
|
| 364 | + <?php if ($scrollwheel) { ?>checked="checked" <?php } ?> />
|
|
| 365 | 365 | </label> |
| 366 | 366 | </p> |
| 367 | 367 | |
@@ -69,10 +69,11 @@ discard block |
||
| 69 | 69 | $totalcount = count(array_unique($list_map_json)); |
| 70 | 70 | |
| 71 | 71 | |
| 72 | - if (!empty($cat_content_info)) |
|
| 73 | - $list_json = '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']';
|
|
| 74 | - else |
|
| 75 | - $list_json = '[{"totalcount":"0"}]';
|
|
| 72 | + if (!empty($cat_content_info)) { |
|
| 73 | + $list_json = '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']'; |
|
| 74 | + } else { |
|
| 75 | + $list_json = '[{"totalcount":"0"}]'; |
|
| 76 | + } |
|
| 76 | 77 | |
| 77 | 78 | $listing_map_args = array('list_json' => $list_json);
|
| 78 | 79 | |
@@ -195,7 +196,9 @@ discard block |
||
| 195 | 196 | $mapview = $maptype; |
| 196 | 197 | } |
| 197 | 198 | |
| 198 | - if (empty($mapzoom)) $mapzoom = $zoom; |
|
| 199 | + if (empty($mapzoom)) { |
|
| 200 | + $mapzoom = $zoom; |
|
| 201 | + } |
|
| 199 | 202 | |
| 200 | 203 | // Set default map options |
| 201 | 204 | $map_args['ajax_url'] = geodir_get_ajax_url(); |
@@ -323,8 +326,9 @@ discard block |
||
| 323 | 326 | |
| 324 | 327 | foreach ($map_zoom_level as $level) {
|
| 325 | 328 | $selected = ''; |
| 326 | - if ($level == $zoom) |
|
| 327 | - $selected = 'selected="selected"'; |
|
| 329 | + if ($level == $zoom) { |
|
| 330 | + $selected = 'selected="selected"'; |
|
| 331 | + } |
|
| 328 | 332 | |
| 329 | 333 | echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>'; |
| 330 | 334 | |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | * @since 1.5.6 |
| 198 | 198 | */ |
| 199 | 199 | global $pagenow; |
| 200 | - // if ( 'plugins.php' === $pagenow ) |
|
| 200 | + // if ( 'plugins.php' === $pagenow ) |
|
| 201 | 201 | {
|
| 202 | 202 | // Better update message |
| 203 | 203 | $file = basename( __FILE__ ); |
@@ -74,7 +74,9 @@ discard block |
||
| 74 | 74 | /** |
| 75 | 75 | * Do not store any revisions (except the one autosave per post). |
| 76 | 76 | */ |
| 77 | -if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 0);
|
|
| 77 | +if (!defined('WP_POST_REVISIONS')) { |
|
| 78 | + define('WP_POST_REVISIONS', 0); |
|
| 79 | +} |
|
| 78 | 80 | |
| 79 | 81 | |
| 80 | 82 | /* |
@@ -82,17 +84,29 @@ discard block |
||
| 82 | 84 | */ |
| 83 | 85 | |
| 84 | 86 | /** Define the database name for the countries table. */ |
| 85 | -if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
|
|
| 87 | +if (!defined('GEODIR_COUNTRIES_TABLE')) { |
|
| 88 | + define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries'); |
|
| 89 | +} |
|
| 86 | 90 | /** Define the database name for the custom fields table. */ |
| 87 | -if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
|
|
| 91 | +if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) { |
|
| 92 | + define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields'); |
|
| 93 | +} |
|
| 88 | 94 | /** Define the database name for the icons table. */ |
| 89 | -if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
|
|
| 95 | +if (!defined('GEODIR_ICON_TABLE')) { |
|
| 96 | + define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon'); |
|
| 97 | +} |
|
| 90 | 98 | /** Define the database name for the attachments table. */ |
| 91 | -if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
|
|
| 99 | +if (!defined('GEODIR_ATTACHMENT_TABLE')) { |
|
| 100 | + define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments'); |
|
| 101 | +} |
|
| 92 | 102 | /** Define the database name for the review table. */ |
| 93 | -if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
|
|
| 103 | +if (!defined('GEODIR_REVIEW_TABLE')) { |
|
| 104 | + define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review'); |
|
| 105 | +} |
|
| 94 | 106 | /** Define the database name for the custom sort fields table. */ |
| 95 | -if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
|
|
| 107 | +if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) { |
|
| 108 | + define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields'); |
|
| 109 | +} |
|
| 96 | 110 | |
| 97 | 111 | |
| 98 | 112 | if ($_SERVER['REQUEST_URI'] == '' || $_SERVER['REQUEST_URI'] == '/') {
|
@@ -107,7 +121,9 @@ discard block |
||
| 107 | 121 | /* |
| 108 | 122 | * Localisation items. |
| 109 | 123 | */ |
| 110 | -if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
|
|
| 124 | +if (!defined('GEODIRECTORY_TEXTDOMAIN')) { |
|
| 125 | + define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory'); |
|
| 126 | +} |
|
| 111 | 127 | |
| 112 | 128 | // Load geodirectory plugin textdomain. |
| 113 | 129 | add_action( 'plugins_loaded', 'geodir_load_textdomain' ); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * This tries to disable cache on homepage as it can be very dynamic. |
| 101 | 101 | */ |
| 102 | 102 | define('DONOTCACHEPAGE', TRUE);
|
| 103 | - $_SERVER['DONOTCACHEPAGE']= TRUE; |
|
| 103 | + $_SERVER['DONOTCACHEPAGE'] = TRUE; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
|
| 111 | 111 | |
| 112 | 112 | // Load geodirectory plugin textdomain. |
| 113 | -add_action( 'plugins_loaded', 'geodir_load_textdomain' ); |
|
| 113 | +add_action('plugins_loaded', 'geodir_load_textdomain');
|
|
| 114 | 114 | |
| 115 | 115 | /* |
| 116 | 116 | * A function to log GD errors no matter the type given. |
@@ -121,18 +121,18 @@ discard block |
||
| 121 | 121 | * @param mixed $log The thing that should be logged. |
| 122 | 122 | * @package GeoDirectory |
| 123 | 123 | */ |
| 124 | -function geodir_error_log($log){
|
|
| 124 | +function geodir_error_log($log) {
|
|
| 125 | 125 | /* |
| 126 | 126 | * A filter to override the WP_DEBUG setting for function geodir_error_log(). |
| 127 | 127 | * |
| 128 | 128 | * @since 1.5.7 |
| 129 | 129 | */ |
| 130 | - $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG); |
|
| 131 | - if ( true === $should_log ) {
|
|
| 132 | - if ( is_array( $log ) || is_object( $log ) ) {
|
|
| 133 | - error_log( print_r( $log, true ) ); |
|
| 130 | + $should_log = apply_filters('geodir_log_errors', WP_DEBUG);
|
|
| 131 | + if (true === $should_log) {
|
|
| 132 | + if (is_array($log) || is_object($log)) {
|
|
| 133 | + error_log(print_r($log, true)); |
|
| 134 | 134 | } else {
|
| 135 | - error_log( $log ); |
|
| 135 | + error_log($log); |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -225,11 +225,11 @@ discard block |
||
| 225 | 225 | // if ( 'plugins.php' === $pagenow ) |
| 226 | 226 | {
|
| 227 | 227 | // Better update message |
| 228 | - $file = basename( __FILE__ ); |
|
| 229 | - $folder = basename( dirname( __FILE__ ) ); |
|
| 228 | + $file = basename(__FILE__); |
|
| 229 | + $folder = basename(dirname(__FILE__)); |
|
| 230 | 230 | $hook = "in_plugin_update_message-{$folder}/{$file}";
|
| 231 | 231 | //echo $hook; |
| 232 | - add_action( 'in_plugin_update_message-geodirectory/geodirectory.php', 'geodire_admin_upgrade_notice', 20, 2 ); |
|
| 232 | + add_action('in_plugin_update_message-geodirectory/geodirectory.php', 'geodire_admin_upgrade_notice', 20, 2);
|
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | } |
@@ -114,10 +114,10 @@ |
||
| 114 | 114 | //include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
| 115 | 115 | } |
| 116 | 116 | /** |
| 117 | - * Contains functions used for Rest API. |
|
| 118 | - * |
|
| 119 | - * @since 1.5.4 |
|
| 120 | - */ |
|
| 117 | + * Contains functions used for Rest API. |
|
| 118 | + * |
|
| 119 | + * @since 1.5.4 |
|
| 120 | + */ |
|
| 121 | 121 | if (is_plugin_active('rest-api/plugin.php')) { |
| 122 | 122 | //include_once('api.php'); |
| 123 | 123 | } |