Plugin Directory

Changeset 3190770


Ignore:
Timestamp:
11/17/2024 07:50:49 PM (14 months ago)
Author:
angel_aparicio_gomez
Message:

Added bluesky

Location:
basic-sharer
Files:
16 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • basic-sharer/trunk/basic-sharer.php

    r2918106 r3190770  
    55Author: Angel Aparicio
    66Author URI: https://angelaparicio.dev
    7 Version: 0.5
     7Version: 0.6
    88Text Domain: basic_sharer
    99Domain Path: /languages
     
    2929            'visible' => get_option('basic_sharer_facebook', true)
    3030        ), 
    31         'Twitter' => array(
    32             'link' => 'https://twitter.com/share?text='.$title.'&url='.$permalink,
    33             'logo' => plugin_dir_url(__FILE__).'images/tw-24.png',
     31        'X' => array(
     32            'link' => 'https://x.com/share?text='.$title.'&url='.$permalink,
     33            'logo' => plugin_dir_url(__FILE__).'images/x-24.png',
    3434            'visible' => get_option('basic_sharer_twitter', true)           
    3535        ),
     
    3939            'visible' => get_option('basic_sharer_linkedin', true)         
    4040        ),
     41        'Bluesky' => array(
     42            'link' => 'https://bsky.app/intent/compose?text='.$title.' '.$permalink,
     43            'logo' => plugin_dir_url(__FILE__).'images/bsky-24.png',
     44            'visible' => get_option('basic_sharer_bluesky', true)       
     45        )
    4146    );
    4247   
     
    4651    foreach ( $links as $network_name => $link_info ){
    4752        if ($link_info['visible']) {
    48             $share_links .= '<a href="'.$link_info['link'].'" class="external share_'.strtolower($network_name).'" target="_blank"><img style="display: inline" src="'.$link_info['logo'].'" alt="'.$network_name.'" /></a> ';
     53            $share_links .= '<a href="'.$link_info['link'].'" class="external share_'.strtolower($network_name).'" target="_blank"><img style="display: inline" src="'.$link_info['logo'].'" alt="'.$network_name.'" /></a> &nbsp; ';
    4954        }
    5055    }   
     
    6166
    6267function basic_sharer_render_options_page(){
     68   
     69   
     70    if ( isset($_POST['basic_share_nonce']) && wp_verify_nonce( sanitize_text_field(wp_unslash($_POST['basic_share_nonce'])), 'basic_share_save' ) ) {
    6371
    64     if ( isset($_POST['basic_sharer_saving_data']) ){
    65    
    6672        $basic_sharer_facebook = isset($_POST['basic_sharer_facebook']);
    6773        $basic_sharer_twitter  = isset($_POST['basic_sharer_twitter']);
    6874        $basic_sharer_linkedin = isset($_POST['basic_sharer_linkedin']);
     75        $basic_sharer_bluesky  = isset($_POST['basic_sharer_bluesky']);
    6976       
    7077        update_option('basic_sharer_facebook', $basic_sharer_facebook);
    71         update_option('basic_sharer_twitter', $basic_sharer_twitter);
    72         update_option('basic_sharer_linkedin', $basic_sharer_linkedin);
     78        update_option('basic_sharer_twitter',  $basic_sharer_twitter);
     79        update_option('basic_sharer_linkedin', $basic_sharer_linkedin);
     80        update_option('basic_sharer_bluesky',  $basic_sharer_bluesky);
    7381
    74         echo '<div class="updated"><p><strong>'.__('Updated', 'basic_sharer').'</strong></p></div>';
    75    
    7682    }
    7783    else {
    7884        $basic_sharer_facebook = get_option('basic_sharer_facebook', true);
    79         $basic_sharer_twitter = get_option('basic_sharer_twitter', true);
     85        $basic_sharer_twitter  = get_option('basic_sharer_twitter', true);
    8086        $basic_sharer_linkedin = get_option('basic_sharer_linkedin', true);
     87        $basic_sharer_bluesky  = get_option('basic_sharer_bluesky',  true);
     88
    8189    }
    8290   
  • basic-sharer/trunk/options_page.php

    r2918106 r3190770  
    11<div class="wrap">
    22
    3    <h2><?php _e( 'Basic Sharer Options', 'basic_sharer'); ?></h2>
     3   <h2><?php esc_html_e( 'Basic Sharer Options', 'basic_sharer'); ?></h2>
    44
    5    <form name="form" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>" style="padding-top: 1em;">
     5   <form name="form" method="post" style="padding-top: 1em;">
    66
    7       <h3><?php _e( 'Social Networks to include', 'basic_sharer' ) ?></h3>
     7      <h3><?php esc_html_e( 'Social Networks to include', 'basic_sharer' ) ?></h3>
    88
    99      <div class="inline-edit-col">
    10 
    11          <label for="basic_sharer_facebook" class="title">Facebook:</label>
     10         <label for="basic_sharer_bluesky" class="title">Bluesky:</label>
    1211         <span class="input-text-wrap">
    13             <input type="checkbox" id="basic_sharer_facebook" name="basic_sharer_facebook" <?php if ($basic_sharer_facebook) echo 'checked' ?> />
     12            <input type="checkbox" id="basic_sharer_bluesky" name="basic_sharer_bluesky" <?php if ($basic_sharer_bluesky) echo 'checked' ?> />
    1413         </span>
    1514      </div>
    1615
    1716      <div class="inline-edit-col" style="padding-top: 1em;">
    18          <label for="basic_sharer_twitter" class="title">Twitter:</label>
     17         <label for="basic_sharer_facebook" class="title">Facebook:</label>
    1918         <span class="input-text-wrap">
    20             <input type="checkbox" id="basic_sharer_twitter" name="basic_sharer_twitter" <?php if ($basic_sharer_twitter) echo 'checked' ?> />
     19            <input type="checkbox" id="basic_sharer_facebook" name="basic_sharer_facebook" <?php if ($basic_sharer_facebook) echo 'checked' ?> />
    2120         </span>
    2221      </div>
     
    2928      </div>
    3029
     30      <div class="inline-edit-col" style="padding-top: 1em;">
     31         <label for="basic_sharer_twitter" class="title">X:</label>
     32         <span class="input-text-wrap">
     33            <input type="checkbox" id="basic_sharer_twitter" name="basic_sharer_twitter" <?php if ($basic_sharer_twitter) echo 'checked' ?> />
     34         </span>
     35      </div>
     36
    3137      <div class="submit">
     38         <?php wp_nonce_field( 'basic_share_save', 'basic_share_nonce' ); ?>
    3239         <input type="hidden" name="basic_sharer_saving_data" value="true" />
    3340         <input class="button" type="submit" name="Submit" />
  • basic-sharer/trunk/readme.txt

    r3007643 r3190770  
    33Tags: social, share
    44Requires at least: 5.0
    5 Tested up to: 6.4
    6 Requires PHP: 7.1
    7 Stable Tag: 0.5
     5Tested up to: 6.7
     6Requires PHP: 8.0
     7Stable Tag: 0.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1818
    1919== Changelog ==
     20
     21= 0.5 =
     22Changes for WordPress guidelines
    2023
    2124= 0.5 =
Note: See TracChangeset for help on using the changeset viewer.