Plugin Directory

Changeset 2656764

Timestamp:
01/12/2022 04:13:37 PM (3 years ago)
Author:
igmoweb
Message:

New version: 2.0.0

Location:
append-or-prepend-content
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • append-or-prepend-content/trunk/app-prep-content.php

    r2229656 r2656764  
    1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
    2 
     1<?php
    32/**
    43 * Plugin Name: Append or Prepend Content
    54 * Description: Add content before or after every post, page or Custom Post Type
    65 * Plugin URI: https://wordpress.org/plugins/append-or-prepend-content
    7  * Version: 1.3.1
     6 * Version:
    87 * Author: igmoweb
    98 * Author URI: http://igmoweb.com
     
    1110 * Domain path: /languages
    1211 * License: GPLv2 or later (license.txt)
     12
     13
    1314 */
    14 class AppOrPrepp {
    1515
    16     /**
    17      * Plugin instance.
    18      *
    19      * @var AppOrPrepp
    20      */
    21     private static $instance;
     16namespace AppOrPrepend;
    2217
    23     /**
    24      * Get a single instance of the plugin.
    25      *
    26      * @return AppOrPrepp
    27      */
    28     public static function get_instance() {
    29         if ( ! self::$instance ) {
    30             self::$instance = new self();
    31         }
     18use AppOrPrepend\PostType;
     19use AppOrPrepend\Meta;
     20use AppOrPrepend\Editor;
     21use AppOrPrepend\Content;
    3222
    33         return self::$instance;
    34     }
     23const PLUGIN_VERSION = '2.0.0';
    3524
    36     /**
    37      * AppOrPrepp constructor.
    38     */
    39     public function __construct() {
    40         if ( is_admin() ) {
    41             include_once plugin_dir_path( __FILE__ ) . '/class-apporprepp-admin.php';
    42             new AppOrPrepp_Admin();
    43         }
     25/**
     26.
     27 */
     28t() {
     29   
     30    .php';
     31    ;
     32   
    4433
    45         add_filter( 'the_content', [ $this, 'the_content' ] );
     34    );
    4635
    47         add_action( 'plugins_loaded', [ $this, 'load_text_domain' ], 50 );
    48     }
     36    Content\init();
     37    Meta\init();
     38    PostType\init();
     39    Editor\init();
    4940
    50     /**
    51      * Load the plugin text domain
    52      */
    53     public function load_text_domain() {
    54         load_plugin_textdomain( 'apporprepp', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
    55     }
     41    if ( is_admin() ) {
     42        include_once plugin_dir_path( __FILE__ ) . '/inc/admin.php';
     43        include_once plugin_dir_path( __FILE__ ) . '/inc/upgrade.php';
     44        Admin\init();
    5645
    57     /**
    58      * Display content before or after
    59      *
    60      * @param string $content The post content.
    61      *
    62      * @return string
    63      */
    64     public function the_content( $content ) {
    65         $post      = get_post();
    66         $post_type = get_post_type( $post );
    67 
    68         if ( is_archive() || is_search() || is_home() ) {
    69             $display_in_archive = absint( get_option( 'display_in_archive_' . $post_type, 1 ) );
    70             if ( ! $display_in_archive ) {
    71                 return $content;
    72             }
    73         }
    74 
    75         $display_in_single = absint( get_option( 'display_in_single_' . $post_type, 1 ) );
    76         if ( is_singular( $post_type ) && ! $display_in_single ) {
    77             return $content;
    78         }
    79 
    80         if ( ! apply_filters( 'app_or_prepend.display_content', true ) ) {
    81             return $content;
    82         }
    83 
    84         $prepend = get_option( 'prepend_' . $post_type, '' );
    85         $append  = get_option( 'append_' . $post_type, '' );
    86 
    87         if ( $prepend ) {
    88             $content = wpautop( $prepend ) . $content;
    89         }
    90 
    91         if ( $append ) {
    92             $content = $content . wpautop( $append );
    93         }
    94 
    95         return $content;
     46        add_action( 'admin_init', __NAMESPACE__ . '\\Admin\\maybe_upgrade' );
    9647    }
    9748}
    9849
    99 add_action( 'plugins_loaded', 'app_or_prepp' );
    10050/**
    101  * Return the plugin instance
     51 * Load the plugin text domain
     52 */
     53function load_text_domain() {
     54    load_plugin_textdomain( 'apporprepp', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
     55}
     56
     57/**
     58 * Retrieve the plugin URL.
    10259 *
    103  * @return AppOrPrepp
     60 * @return
    10461 */
    105 function app_or_prepp() {
    106     return AppOrPrepp::get_instance();
     62function app_or_prep {
     63    return );
    10764}
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
  • append-or-prepend-content/trunk/languages/apporprepp-es_ES.po

    r2229656 r2656764  
    1 # Copyright (C) 2016 Append or Prepend Content
    2 # This file is distributed under the same license as the Append or Prepend Content package.
     1# Copyright (C) 20
     2# This file is distributed under the .
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Append or Prepend Content 1.0\n"
    6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/app-prep-content\n"
    7 "POT-Creation-Date: 2020-01-13 16:43:34+00:00\n"
     5"Project-Id-Version: Append or Prepend Content %%version%%\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/append-or-prepend-"
     7"content\n"
     8"Last-Translator: \n"
     9"Language-Team: Español\n"
    810"MIME-Version: 1.0\n"
    911"Content-Type: text/plain; charset=UTF-8\n"
    1012"Content-Transfer-Encoding: 8bit\n"
    11 "PO-Revision-Date: 2020-01-13 16:44+0000\n"
    12 "Last-Translator: admin <admin@local.test>\n"
    13 "Language-Team: Español\n"
     13"POT-Creation-Date: 2022-01-11T19:37:21+00:00\n"
     14"PO-Revision-Date: 2022-01-12 15:45+0000\n"
    1415"X-Generator: Loco https://localise.biz/\n"
    15 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    16 "Language: es_ES\n"
    17 "X-Loco-Version: 2.3.1; wp-5.4-alpha-47065"
     16"X-Domain: apporprepp\n"
     17"Language: es-ES\n"
     18"Plural-Forms: nplurals=2; plural=n != 1;\n"
     19"X-Loco-Version: 2.5.5; wp-5.8.3"
    1820
    19 #: class-apporprepp-admin.php:21
    20 msgid "Append or Prepend Content Settings"
    21 msgstr "Opciones de Append o Prepend Content"
     21#:
     22msgid ""
     23msgstr ""
    2224
    23 #: class-apporprepp-admin.php:120
    24 msgid ""
    25 "Allows you to append or prepend content to any Post Type on your site. "
    26 "Shortcodes allowed."
     25#: src/components/ActionControl.js:9
     26msgid "Action"
     27msgstr "Agregar contenido previo/posterior"
     28
     29#: src/components/PostTypeControl.js:18
     30msgctxt ""
     31"Action to perform on a post type. i.e. Append to/Prepend to where %s is the "
     32"post type"
     33msgid "%s to "
     34msgstr "%s a "
     35
     36#. Description of the plugin
     37msgid "Add content before or after every post, page or Custom Post Type"
    2738msgstr ""
    28 "Permite agregar contenido antes o después de cada entrada, página o Tipo de "
    29 "Post Personalizado"
     39" "
     40"ersonalizado"
    3041
    31 #. Plugin Name of the plugin/theme
     42#: inc/admin.php:54
     43msgid "Add new"
     44msgstr "Añadir nuevo"
     45
     46#: inc/post-type.php:34
     47msgid "Add New Append or Prepend Content"
     48msgstr "Añadir nuevo contenido previo/posterior"
     49
     50#: inc/admin.php:50
     51msgid "Add new content to append/prepend"
     52msgstr "Añadir nuevo contenido previo/posterior"
     53
     54#: inc/post-type.php:32
     55msgctxt "add new post-type on admin bar"
    3256msgid "Append or Prepend Content"
    3357msgstr ""
    3458
    35 #. Plugin URI of the plugin/theme
    36 msgid "https://wordpress.org/plugins/app-prep-content"
     59#: inc/post-type.php:31
     60msgctxt "admin menu"
     61msgid "Append Content"
     62msgstr "Anexar contenido"
     63
     64#: inc/post-type.php:42
     65msgid "All Append or Prepend Contents"
     66msgstr "Todos los contenidos previos/posteriores agregados"
     67
     68#: src/components/ActionControl.js:21
     69msgid "Append"
     70msgstr "Anexar"
     71
     72#. Plugin Name of the plugin
     73#: inc/admin.php:23
     74msgid "Append or Prepend Content"
    3775msgstr ""
    3876
    39 #. Description of the plugin/theme
    40 msgid "Add content before or after every post, page or Custom Post Type"
     77#: src/index.js:21
     78msgid "Append or Prepend Options"
     79msgstr "Opciones de Append Or Prepend Content"
     80
     81#: src/components/ArchiveControl.js:11
     82msgid "Display in archives"
     83msgstr "Mostrar en páginas de archivo"
     84
     85#: src/components/SinglePostControl.js:9
     86msgid "Display in single post"
     87msgstr "Mostrar en entrada individual"
     88
     89#: inc/post-type.php:35
     90msgid "Edit Append or Prepend Content"
     91msgstr "Editar contenido previo/posterior"
     92
     93#. Author URI of the plugin
     94msgid "http://igmoweb.com"
    4195msgstr ""
    42 "Agrega contenido antes o después de cada entrada, página o tipo de Post "
    43 "Personalizado"
    4496
    45 #. Author of the plugin/theme
     97#. Plugin URI of the plugin
     98msgid "https://wordpress.org/plugins/append-or-prepend-content"
     99msgstr ""
     100
     101#: src/components/ArchiveControl.js:12
     102msgid ""
     103"If the content should appear when a list of posts is retrieved (in search, "
     104"archives...). Does not apply in excerpts"
     105msgstr ""
     106"Si la opción está activada, el contenido aparecerá cuando la lista de "
     107"entradas (en el blog, búsqueda, archivos...) se muestra en pantalla. No "
     108"aplica a los extractos."
     109
     110#: src/components/SinglePostControl.js:10
     111msgid "If the content should appear when a single post is retrieved"
     112msgstr ""
     113"Si la opción está activada, el contenido aparecerá en una entrada individual"
     114
     115#. Author of the plugin
    46116msgid "igmoweb"
    47117msgstr ""
    48118
    49 #. Author URI of the plugin/theme
    50 msgid "http://igmoweb.com"
     119#: inc/post-type.php:36
     120msgid "New Append or Prepend Content"
     121msgstr "Nuevo contenido a agregar"
     122
     123#: inc/post-type.php:40
     124msgid "No posts found in Trash."
     125msgstr "No se encontró contenido en la papelera."
     126
     127#: inc/post-type.php:39
     128msgid "No posts found."
     129msgstr "No se encontró contenido."
     130
     131#: inc/post-type.php:41
     132msgid "Parent Append or Prepend Content:"
    51133msgstr ""
    52134
    53 #: class-apporprepp-admin.php:36
    54 msgctxt "%s is the post type"
    55 msgid "Prepend content to %s"
    56 msgstr "Agregar contenido previo a %s"
     135#: src/index.js:26
     136msgid "Please, save the post first in order to select an action."
     137msgstr "Por favor, guarde el contenido antes de seleccionar una opción."
    57138
    58 #: class-apporprepp-admin.php:48
    59 msgctxt "%s is the post type"
    60 msgid "Append content to %s"
    61 msgstr "Agregar contenido a %s"
     139#:
     140msgctxt "e"
     141msgid "Append "
     142msgstr ""
    62143
    63 #. translators: %s is the post type.
    64 #: class-apporprepp-admin.php:60
    65 msgctxt "%s is the post type"
    66 msgid "Display content for %s in the archive, search or author pages"
     144#: inc/post-type.php:30
     145msgctxt "post type singular name"
     146msgid "Append or Prepend Content"
    67147msgstr ""
    68 "Muestra contenido para el tipo %s en las páginas de archivo, búsqueda o "
    69 "páginas de autor"
    70148
    71 #. translators: %s is the post type name.
    72 #: class-apporprepp-admin.php:72
    73 msgctxt "%s is the post type"
    74 msgid "Display content when viewing a single %s"
    75 msgstr "Mostrar contenido al mostrar un/a %s en particular"
     149#: inc/post-type.php:33
     150msgctxt "post_type"
     151msgid "Add New"
     152msgstr "Añadir nuevo"
     153
     154#: src/components/ActionControl.js:20
     155msgid "Prepend"
     156msgstr "Agregar antes"
     157
     158#: inc/post-type.php:38
     159msgid "Search Append or Prepend Content"
     160msgstr "Buscar contenido agregado."
     161
     162#: src/components/ActionControl.js:13
     163msgctxt "select an action: prepend/append"
     164msgid "-- Select an option --"
     165msgstr "-- Seleccione una opción --"
     166
     167#: inc/admin.php:44
     168msgid "View"
     169msgstr "Ver"
     170
     171#: inc/post-type.php:37
     172msgid "View Append or Prepend Content"
     173msgstr "Ver contenido agregado"
     174
     175#: inc/admin.php:40
     176msgid "View current appended/prepended content"
     177msgstr "Ver contenido agregado actual"
  • append-or-prepend-content/trunk/languages/apporprepp.pot

    r2229656 r2656764  
    1 # Copyright (C) 2020 igmoweb
     1# Copyright (C) 202 igmoweb
    22# This file is distributed under the GPLv2 or later (license.txt).
    33msgid ""
    44msgstr ""
    55"Project-Id-Version: Append or Prepend Content %%version%%\n"
    6 "Report-Msgid-Bugs-To: "
    7 "https://wordpress.org/support/plugin/append-or-prepend-content\n"
    8 "POT-Creation-Date: 2020-01-18 15:02:16+00:00\n"
    9 "MIME-Version: 1.0\n"
    10 "Content-Type: text/plain; charset=utf-8\n"
    11 "Content-Transfer-Encoding: 8bit\n"
    12 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/append-or-prepend-content\n"
    137"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    148"Language-Team: LANGUAGE <LL@li.org>\n"
    15 "X-Generator: grunt-wp-i18n 1.0.3\n"
     9"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
     11"Content-Transfer-Encoding: 8bit\n"
     12"POT-Creation-Date: 2022-01-12T16:10:45+00:00\n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.5.0\n"
     15"X-Domain: apporprepp\n"
    1616
    17 #: class-apporprepp-admin.php:21
    18 msgid "Append or Prepend Content Settings"
    19 msgstr ""
    20 
    21 #: class-apporprepp-admin.php:120
    22 msgid ""
    23 "Allows you to append or prepend content to any Post Type on your site. "
    24 "Shortcodes allowed."
    25 msgstr ""
    26 
    27 #. Plugin Name of the plugin/theme
     17#. Plugin Name of the plugin
     18#: inc/admin.php:23
    2819msgid "Append or Prepend Content"
    2920msgstr ""
    3021
    31 #. Plugin URI of the plugin/theme
     22#. Plugin URI of the plugin
    3223msgid "https://wordpress.org/plugins/append-or-prepend-content"
    3324msgstr ""
    3425
    35 #. Description of the plugin/theme
     26#. Description of the plugin
    3627msgid "Add content before or after every post, page or Custom Post Type"
    3728msgstr ""
    3829
    39 #. Author of the plugin/theme
     30#. Author of the plugin
    4031msgid "igmoweb"
    4132msgstr ""
    4233
    43 #. Author URI of the plugin/theme
     34#. Author URI of the plugin
    4435msgid "http://igmoweb.com"
    4536msgstr ""
    4637
    47 #: class-apporprepp-admin.php:36
    48 #. translators: %s is the post type.
    49 msgctxt "%s is the post type"
    50 msgid "Prepend content to %s"
     38#: inc/admin.php:40
     39msgid "View current appended/prepended content"
    5140msgstr ""
    5241
    53 #: class-apporprepp-admin.php:48
    54 #. translators: %s is the post type.
    55 msgctxt "%s is the post type"
    56 msgid "Append content to %s"
     42#: inc/admin.php:44
     43msgid "View"
    5744msgstr ""
    5845
    59 #: class-apporprepp-admin.php:60
    60 #. translators: %s is the post type.
    61 msgctxt "%s is the post type"
    62 msgid "Display content for %s in the archive, search or author pages"
     46#: inc/admin.php:50
     47msgid "Add new content to append/prepend"
    6348msgstr ""
    6449
    65 #: class-apporprepp-admin.php:72
    66 #. translators: %s is the post type name.
    67 msgctxt "%s is the post type"
    68 msgid "Display content when viewing a single %s"
     50#: inc/admin.php:54
     51msgid "Add new"
    6952msgstr ""
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
  • append-or-prepend-content/trunk/readme.txt

    r2229656 r2656764  
    11=== Append or Prepend Content ===
    2 Contributors: igmoweb, alexandernst
     2Contributors: igmoweb
    33Tags: content,posts,custom post type
    4 Requires at least: 4.0
    5 Tested up to: 5.3.2
    6 Stable tag: 1.3.1
     4Requires at least: 5.7
     5Tested up to: 5.9
     6Stable tag: 2.0.0
     7Requires PHP: 7.3
    78License: GPLv2 or later
    89
     
    1011
    1112== Description ==
    12 Append or Prepend Content allows you to append or prepend content to any Post Type on your site. You can even use shortcodes or HTML.
     13Append or Prepend Content allows you to append or prepend content .
    1314
    1415== Installation ==
     
    16172. Search for 'Append or Prepend Content'
    17183. Activate Append or Prepend Content from your Plugins page.
    18 4. Navigate to Settings > Writing and fill the plugin options
     194. Navigate to Settings > Writing and
    1920
    2021== Screenshots ==
    21221. **Plugin Settings**
     23
    2224
    2325== Changelog ==
     26
     27
     28
    2429= 1.3.1 =
    2530Fix: Content was displayed at blog page even if archive option was not selected
Note: See TracChangeset for help on using the changeset viewer.