Skip to content

Commit

Permalink
Ready for v1
Browse files Browse the repository at this point in the history
replaced `[]` with `array()`
  • Loading branch information
shramee committed Oct 3, 2017
1 parent 6c3595e commit b725c59
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
22 changes: 11 additions & 11 deletions fs-testimonial.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ static function get_testimonials( $plugin ) {
include 'inc/freemius/Freemius.php';
}

$settings = get_option( 'fstm_credentials', [] );
$settings = get_option( 'fstm_credentials', array() );

if ( ! $settings ) {
return (object) [
'error' => [ 'message' => 'API credentials not set.', ]
];
return (object) array(
'error' => array( 'message' => 'API credentials not set.', )
);
}

// Init SDK.
Expand All @@ -64,11 +64,11 @@ static function get_testimonials( $plugin ) {
* FS_Testimonials constructor.
*/
public function __construct() {
add_shortcode( 'freemius-testimonials', [ $this, 'testimonials' ] );
add_shortcode( 'freemius-testimonials', array( $this, 'testimonials' ) );

add_action( 'admin_init', [ $this, 'admin' ] );
add_action( 'admin_init', array( $this, 'admin' ) );

add_action( 'wp_enqueue_scripts', [ $this, 'scripts' ] );
add_action( 'wp_enqueue_scripts', array( $this, 'scripts' ) );
}

public function admin() {
Expand All @@ -78,7 +78,7 @@ public function admin() {
add_settings_section(
'fstm_general_section',
'',
[ $this, 'admin_section_render' ],
array( $this, 'admin_section_render' ),
'general'
);

Expand All @@ -89,17 +89,17 @@ public function admin_section_render() {
}

public function scripts() {
wp_enqueue_style( 'fmt-script', plugin_dir_url( __FILE__ ) . '/assets/front.css', '' );
wp_enqueue_style( 'fmt-script', plugin_dir_url( __FILE__ ) . '/assets/front.css', '', '1.0.0' );
}

/**
* Renders testimonials
* @param array $params
* @return string
*/
function testimonials( $params = [] ) {
function testimonials( $params = array() ) {

$params = $params ? $params : [];
$params = $params ? $params : array();

$compress = '';

Expand Down
12 changes: 6 additions & 6 deletions inc/tpl.admin-section.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* Admin settings section
*/

$settings = get_option( 'fstm_credentials', [] );
$settings = get_option( 'fstm_credentials', array() );

$settings = wp_parse_args( $settings, [
'dev_id' => '',
'dev_public' => '',
'dev_secret' => '',
] );
$settings = wp_parse_args( $settings, array(
'dev_id' => '',
'dev_public' => '',
'dev_secret' => '',
) );
?>
<div id="freemius-testimonials"></div>

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ You can use this shortcode after replacing 999 with your plugin ID `[freemius-te
== Changelog ==

= 1.0.0 =
* 2017-10-05
* 2017-10-03
* Initial release. It's alive!

0 comments on commit b725c59

Please sign in to comment.