Plugin Directory

Changeset 1446205


Ignore:
Timestamp:
06/30/2016 04:17:33 AM (10 years ago)
Author:
Ruxton
Message:

Add support for HUM url shortener

Location:
master-link/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • master-link/trunk/master-link.php

    r1435539 r1446205  
    66Author:       Greg Tangey
    77Author URI:   http://ignite.digitalignition.net/
    8 Version:      0.2.0
     8Version:      0.2.1
    99*/
    1010
     
    171171      // Initialize Settings
    172172      require_once(sprintf("%s/settings.php", dirname(__FILE__)));
     173      include_once( ABSPATH . 'wp-admin/includes/plugin.php');
     174
    173175      $MasterLink_Plugin_Settings = new MasterLink_Plugin_Settings();
    174176      $this->slug = get_option('master_link_plugin-slug',$this->slug);
     
    182184      add_action( 'wp_enqueue_scripts',array($this,'add_scripts'));
    183185      add_filter( 'single_template', array($this,'master_link_add_template'), 10);
     186      if(class_exists(Hum) && is_plugin_active("hum/hum.php")) {
     187        add_filter('hum_type_prefix', 'master_link_hum_type_prefix', 10, 2);
     188      }
     189    }
     190
     191    function master_link_hum_type_prefix( $prefix, $post_id ) {
     192      $post = get_post( $post_id );
     193
     194      if ( $post->post_type == 'master_link' ) {
     195        $prefix = get_option('master_link_plugin-hum','m');
     196      }
     197
     198      return $prefix;
    184199    }
    185200
  • master-link/trunk/readme.txt

    r1435539 r1446205  
    44Tags: links, app store, digital storefronts, deezer, itunes, google play, steam, amazon, soundcloud, youtube
    55Requires at least: 4.3.1
    6 Tested up to: 4.5.1
    7 Stable tag: 0.2.0
     6Tested up to: 4.5.3
     7Stable tag: 0.2.1
    88
    99Create links that link to multiple storefronts.  Great for music or software that is sold on many digital storefronts
     
    2323== Changelog ==
    2424
     25= 0.2.0 =
     26* Fixes some visual problems on mobile and adds the automatic searching of iTunes, Deezer & Spotify based on UPC.
     27
     28= 0.1.1 =
     29* Some minor bug fixes
     30
    2531= 0.1.0 =
    2632* Initial release
  • master-link/trunk/settings.php

    r1420662 r1446205  
    2525            ), 'master_link_plugin');
    2626
    27             // add your setting's fields
     27            // Add URL Slug field
    2828            add_settings_field('master_link_plugin-slug', 'URL Slug', array(
    2929                &$this,
     
    3131            ), 'master_link_plugin', 'wp_plugin_template-section');
    3232
     33            // Add HUM config
     34            if(class_exists(Hum) && is_plugin_active("hum/hum.php")) {
     35              add_settings_field('master_link_plugin-hum', 'HUM Short URL Slug', array(
     36                  &$this,
     37                  'settings_field_input_text_hum'
     38              ), 'master_link_plugin', 'wp_plugin_template-section');
     39            }
     40
     41            // Add Use default template
    3342            add_settings_field('master_link_plugin-use_template', 'Use Plugin Template', array(
    3443                &$this,
     
    4453        {
    4554            echo 'These are the only paramters needed to get the plugin to work';
     55        }
     56
     57        public function settings_field_input_text_hum()
     58        {
     59            $this->settings_field_input_text(array(
     60              'field' => 'hum',
     61              'default' => 'm'
     62            ));
    4663        }
    4764
Note: See TracChangeset for help on using the changeset viewer.