Plugin Directory

Changeset 3305442


Ignore:
Timestamp:
06/03/2025 05:55:14 AM (10 months ago)
Author:
jamesdlow
Message:

1.1.0

  • Link detection even if not last line in caption
Location:
lander-for-instagram
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • lander-for-instagram/trunk/instagram-lander.php

    r3101474 r3305442  
    33Plugin Name: Lander For IG
    44Plugin URI: https://wordpress.org/plugins/lander-for-instagram
    5 Version: 1.0.9
     5Version: 1.1.0
    66Description: Landing page featuring a mirror of your instagram feed with links to related posts
    77Author: James Low
     
    2727    }
    2828    public static function ajax() {
    29         if (current_user_can('administrator')) {
     29        //if (current_user_can('administrator')) {
     30        if (current_user_can('read')) {
    3031            $method = $_REQUEST['method'];
    3132            if ($method == 'accesstoken') {
     
    4546    public static function admin_menu() {
    4647        //add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function);
    47         add_options_page('Instagram Lander', 'Instagram Lander', 'manage_options', self::$PREFIX, array('Instagram_Lander', 'options_page'));
     48        //add_options_page('Instagram Lander', 'Instagram Lander', 'manage_options', self::$PREFIX, array('Instagram_Lander', 'options_page'));
     49        add_options_page('Instagram Lander', 'Instagram Lander', 'read', self::$PREFIX, array('Instagram_Lander', 'options_page'));
    4850        add_action('admin_init', array('Instagram_Lander', 'admin_init'));
    4951    }
     
    117119';
    118120            $default_link = $a['default_link'];
    119            
     121            $default_link == '' ? get_site_url() : $default_link;
    120122            foreach ($rows as $row) {
    121123                $caption = trim(str_replace("\n", ' ', $row->caption));
     
    124126                //$link = $default_link == '' ? $row->permalink : $default_link;
    125127                $target = '';
    126                 $link = $default_link == '' ? get_site_url() : $default_link;
    127                 if (count($parts) > 0) {
    128                     $last = $parts[count($parts)-1];
    129                     if (strpos($last, 'http') === 0) {
    130                         $link = $last;
     128                $link = $default_link;
     129                foreach ($parts as $part) {
     130                    if (strpos($part, 'http') === 0) {
     131                        $link = $part;
    131132                        $target = '';
    132133                    }
     
    276277<h1>Instagram Lander</h1>
    277278<ol>
    278 <li>Create and add your Facebook App Id</li>
    279 <li>Add your Facebook App Secret</li>
     279<!--<li>Create and add your Facebook App Id</li>
     280<li>Add your Facebook App Secret</li>-->
    280281<li>Click lookup: <button onclick="return instagram_lander_init();">Lookup Info</button></li>
    281282<li>If your browser blocks popup, you may have to enable it and click lookup again</li>
     
    287288<table class="form-table">
    288289    <tr valign="top">
    289         <th scope="row">Facebook App Id</th>
    290         <td><?php echo self::setting('facebook-app','App Id'); ?>
    291         <?php echo self::setting('facebook-secret','App Secret',true); ?></td>
     290        <th scope="row"><!--Facebook App Id--></th>
     291        <td><?php echo self::hidden('facebook-app','App Id'); ?>
     292        <?php echo self::hidden('facebook-secret','App Secret',true); ?></td>
    292293    </tr>
    293294    <tr valign="top">
     
    321322        return '<input placeholder="'.$placeholder.'" type="'.($password?'password':'text').'" name="'.self::$PREFIX.'-'.$id.'" value="'.esc_attr(self::option($id)).'" />';
    322323    }
     324    public static function hidden($id, $placeholder = '', $password = false) {
     325        return '<input placeholder="'.$placeholder.'" type="hidden" name="'.self::$PREFIX.'-'.$id.'" value="'.esc_attr(self::option($id)).'" />';
     326    }
    323327    public static function option($id) {
    324328        return get_option(self::$PREFIX.'-'.$id);
  • lander-for-instagram/trunk/readme.txt

    r3101474 r3305442  
    55Requires at least: 4.0.1
    66Tested up to: 6.5.4
    7 Stable tag: 1.0.9
     7Stable tag: 1.1.0
    88License: MIT License
    99License URI: https://opensource.org/licenses/MIT
     
    3030
    3131== Changelog ==
     32
     33= 1.1.0 =
     34* Link detection even if not last line in caption
    3235
    3336= 1.0.9 =
Note: See TracChangeset for help on using the changeset viewer.