WordPress.org

Plugin Directory

Changeset 734868


Ignore:
Timestamp:
07/01/13 23:05:38 (10 months ago)
Author:
markjaquith
Message:

deploy from git

Location:
page-links-to/trunk
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • page-links-to/trunk/languages/import.rb

    r734475 r734868  
    125125    'zh_TW' => 'zh-tw', 
    126126} 
     127reverse_langs = langs.invert 
    127128require 'pathname' 
     129require 'open-uri' 
    128130plugin = Pathname.new(File.expand_path '../').basename 
    129 url_root = 'http://translate.markjaquith.com/projects/wordpress-plugins/%s/%s/default/export-translations?format=%s' 
    130 files = Dir.glob("*.mo").map { |f| g = f[/#{plugin}-(.*)\.mo/, 1]; [g, langs[g]] } 
    131 files.each do |l| 
     131url_domain = 'http://translate.markjaquith.com' 
     132url_path = '/projects/wordpress-plugins/' 
     133item_url = url_domain + url_path + '%s/%s/default/export-translations?format=%s' 
     134index_url = url_domain + url_path + '%s/' 
     135 
     136formats = [] 
     137language_regex = %r{<a href="#{url_path}#{plugin}/([^/]+)/default"} 
     138 
     139open( format index_url, plugin ) do |f| 
     140    f.each_line do |l| 
     141        if l.match language_regex 
     142            lang = l[language_regex, 1] 
     143            formats << [reverse_langs[lang], lang] 
     144        end 
     145    end 
     146end 
     147 
     148formats.each do |l| 
    132149    ['po', 'mo'].each do |fmt| 
    133         `wget -O #{plugin}-#{l[0]}.#{fmt} #{format url_root, plugin, l[1], fmt} 2>/dev/null` 
     150        `wget -O #{plugin}-#{l[0]}.#{fmt} #{format item_url, plugin, l[1], fmt} 2>/dev/null` 
    134151    end 
    135152    `git checkout #{plugin}-#{l[0]}.*` if `git diff #{plugin}-#{l[0]}.po | ack '^[+-][^+-]{2}' | ack -v 'PO-Revision-Date'`.chomp.length === 0 
  • page-links-to/trunk/page-links-to.php

    r734697 r734868  
    44Plugin URI: http://txfx.net/wordpress-plugins/page-links-to/ 
    55Description: Allows you to point WordPress pages or posts to a URL of your choosing.  Good for setting up navigational links to non-WP sections of your site or to off-site resources. 
    6 Version: 2.9.1 
     6Version: 2.9.2 
    77Author: Mark Jaquith 
    88Author URI: http://coveredwebservices.com/ 
     
    216216     */ 
    217217    function meta_box() { 
    218         $post = get_post(); 
     218        $null = null; 
     219        $post = get_post( $null ); 
    219220        echo '<p>'; 
    220221        wp_nonce_field( 'cws_plt_' . $post->ID, '_cws_plt_nonce', false, true ); 
     
    403404 
    404405    /** 
    405      * Performs a redirect, if appropriate 
     406     * Performs a redirect 
    406407     */ 
    407408    function template_redirect() { 
    408         global $wp_query; 
    409  
    410         if ( ! is_singular() ) 
    411             return; 
    412  
    413         if ( ! get_queried_object_id() ) 
    414             return; 
    415  
    416         $link = $this->get_link( get_queried_object_id() ); 
     409        $link = $this->get_redirect(); 
    417410 
    418411        if ( ! $link ) 
     
    421414        wp_redirect( $link, 301 ); 
    422415        exit; 
     416    } 
     417 
     418    /** 
     419     * gets the redirection URL 
     420     * 
     421     * @return string|bool the redirection URL, or false 
     422     */ 
     423    function get_redirect() { 
     424        if ( ! is_singular() ) 
     425            return false; 
     426 
     427        if ( ! get_queried_object_id() ) 
     428            return false; 
     429 
     430        return $this->get_link( get_queried_object_id() ); 
    423431    } 
    424432 
  • page-links-to/trunk/readme.txt

    r734707 r734868  
    88Requires at least: 3.4   
    99Tested up to: 3.6   
    10 Stable tag: 2.9.1   
     10Stable tag: 2.9.2   
    1111 
    1212Lets you make a WordPress page (or other content type) link to an external URL of your choosing, instead of its WordPress URL. 
     
    5959 
    6060== Changelog == 
     61 
     62= 2.9.1 = 
     63* Restore WordPress 3.4.x functionality. 
    6164 
    6265= 2.9.1 = 
Note: See TracChangeset for help on using the changeset viewer.