consumerKey_500px = $consumerKey; // Gallery shortcode add_action('init', array(&$this, 'register_inceptive_500px_image_showcase_shortcode')); } // end constructor /* -------------------------------------------------- */ /* Shortcode Functions /*-------------------------------------------------- */ /** * Creates the shortcode */ function inceptive_500px_image_showcase_shortcode($atts) { $this->width = (isset($atts['width'])) ? $atts['width'] : 600; $this->height = (isset($atts['height'])) ? $atts['height'] : 400; $this->feature = (isset($atts['feature'])) ? $atts['feature'] : ''; $this->username = (isset($atts['username'])) ? $atts['username'] : ''; $this->num = (isset($atts['num'])) ? $atts['num'] : 10; $this->tag = (isset($atts['tag'])) ? str_replace(" "," ",$atts['tag']) : ''; $this->term = (isset($atts['term'])) ? str_replace(" "," ",$atts['term']) : ''; $this->caption = (isset($atts['caption'])) ? $atts['caption'] : 'on'; $this->post_or_page = (isset($atts['post_or_page'])) ? $atts['post_or_page'] : '1'; if($this->feature=='tag'){ $url= 'https://api.500px.com/v1/photos/search?consumer_key=' . $this->consumerKey_500px . '&tag='.$this->tag.'&rpp=' . $this->num; } else $url = 'https://api.500px.com/v1/photos?consumer_key=' . $this->consumerKey_500px . '&feature=' . $this->feature . '&username=' . $this->username . '&rpp=' . $this->num; $json = file_get_contents($url); $photos = json_decode($json, TRUE); if($this->post_or_page && (!is_single() && !is_page())) return; return $this->inceptive_500px_image_showcase_shortcode_gallery($photos, $this->caption); } function inceptive_500px_image_showcase_shortcode_gallery($photos,$caption='on') { $return_string = '