Changeset 2656764
- Timestamp:
- 01/12/2022 04:13:37 PM (3 years ago)
- 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 3 2 /** 4 3 * Plugin Name: Append or Prepend Content 5 4 * Description: Add content before or after every post, page or Custom Post Type 6 5 * Plugin URI: https://wordpress.org/plugins/append-or-prepend-content 7 * Version: 1.3.16 * Version: 8 7 * Author: igmoweb 9 8 * Author URI: http://igmoweb.com … … 11 10 * Domain path: /languages 12 11 * License: GPLv2 or later (license.txt) 12 13 13 14 */ 14 class AppOrPrepp {15 15 16 /** 17 * Plugin instance. 18 * 19 * @var AppOrPrepp 20 */ 21 private static $instance; 16 namespace AppOrPrepend; 22 17 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 } 18 use AppOrPrepend\PostType; 19 use AppOrPrepend\Meta; 20 use AppOrPrepend\Editor; 21 use AppOrPrepend\Content; 32 22 33 return self::$instance; 34 } 23 const PLUGIN_VERSION = '2.0.0'; 35 24 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 */ 28 t() { 29 30 .php'; 31 ; 32 44 33 45 add_filter( 'the_content', [ $this, 'the_content' ]);34 ); 46 35 47 add_action( 'plugins_loaded', [ $this, 'load_text_domain' ], 50 ); 48 } 36 Content\init(); 37 Meta\init(); 38 PostType\init(); 39 Editor\init(); 49 40 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(); 56 45 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' ); 96 47 } 97 48 } 98 49 99 add_action( 'plugins_loaded', 'app_or_prepp' );100 50 /** 101 * Return the plugin instance 51 * Load the plugin text domain 52 */ 53 function load_text_domain() { 54 load_plugin_textdomain( 'apporprepp', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); 55 } 56 57 /** 58 * Retrieve the plugin URL. 102 59 * 103 * @return AppOrPrepp60 * @return 104 61 */ 105 function app_or_prep p(){106 return AppOrPrepp::get_instance();62 function app_or_prep { 63 return ); 107 64 } 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) 20 16 Append or Prepend Content2 # 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 . 3 3 msgid "" 4 4 msgstr "" 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" 8 10 "MIME-Version: 1.0\n" 9 11 "Content-Type: text/plain; charset=UTF-8\n" 10 12 "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" 14 15 "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" 18 20 19 #: class-apporprepp-admin.php:2120 msgid " Append or Prepend Content Settings"21 msgstr " Opciones de Append o Prepend Content"21 #: 22 msgid "" 23 msgstr "" 22 24 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 26 msgid "Action" 27 msgstr "Agregar contenido previo/posterior" 28 29 #: src/components/PostTypeControl.js:18 30 msgctxt "" 31 "Action to perform on a post type. i.e. Append to/Prepend to where %s is the " 32 "post type" 33 msgid "%s to " 34 msgstr "%s a " 35 36 #. Description of the plugin 37 msgid "Add content before or after every post, page or Custom Post Type" 27 38 msgstr "" 28 " Permite agregar contenido antes o después de cada entrada, página o Tipo de"29 " Post Personalizado"39 " " 40 "ersonalizado" 30 41 31 #. Plugin Name of the plugin/theme 42 #: inc/admin.php:54 43 msgid "Add new" 44 msgstr "Añadir nuevo" 45 46 #: inc/post-type.php:34 47 msgid "Add New Append or Prepend Content" 48 msgstr "Añadir nuevo contenido previo/posterior" 49 50 #: inc/admin.php:50 51 msgid "Add new content to append/prepend" 52 msgstr "Añadir nuevo contenido previo/posterior" 53 54 #: inc/post-type.php:32 55 msgctxt "add new post-type on admin bar" 32 56 msgid "Append or Prepend Content" 33 57 msgstr "" 34 58 35 #. Plugin URI of the plugin/theme 36 msgid "https://wordpress.org/plugins/app-prep-content" 59 #: inc/post-type.php:31 60 msgctxt "admin menu" 61 msgid "Append Content" 62 msgstr "Anexar contenido" 63 64 #: inc/post-type.php:42 65 msgid "All Append or Prepend Contents" 66 msgstr "Todos los contenidos previos/posteriores agregados" 67 68 #: src/components/ActionControl.js:21 69 msgid "Append" 70 msgstr "Anexar" 71 72 #. Plugin Name of the plugin 73 #: inc/admin.php:23 74 msgid "Append or Prepend Content" 37 75 msgstr "" 38 76 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 78 msgid "Append or Prepend Options" 79 msgstr "Opciones de Append Or Prepend Content" 80 81 #: src/components/ArchiveControl.js:11 82 msgid "Display in archives" 83 msgstr "Mostrar en páginas de archivo" 84 85 #: src/components/SinglePostControl.js:9 86 msgid "Display in single post" 87 msgstr "Mostrar en entrada individual" 88 89 #: inc/post-type.php:35 90 msgid "Edit Append or Prepend Content" 91 msgstr "Editar contenido previo/posterior" 92 93 #. Author URI of the plugin 94 msgid "http://igmoweb.com" 41 95 msgstr "" 42 "Agrega contenido antes o después de cada entrada, página o tipo de Post "43 "Personalizado"44 96 45 #. Author of the plugin/theme 97 #. Plugin URI of the plugin 98 msgid "https://wordpress.org/plugins/append-or-prepend-content" 99 msgstr "" 100 101 #: src/components/ArchiveControl.js:12 102 msgid "" 103 "If the content should appear when a list of posts is retrieved (in search, " 104 "archives...). Does not apply in excerpts" 105 msgstr "" 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 111 msgid "If the content should appear when a single post is retrieved" 112 msgstr "" 113 "Si la opción está activada, el contenido aparecerá en una entrada individual" 114 115 #. Author of the plugin 46 116 msgid "igmoweb" 47 117 msgstr "" 48 118 49 #. Author URI of the plugin/theme 50 msgid "http://igmoweb.com" 119 #: inc/post-type.php:36 120 msgid "New Append or Prepend Content" 121 msgstr "Nuevo contenido a agregar" 122 123 #: inc/post-type.php:40 124 msgid "No posts found in Trash." 125 msgstr "No se encontró contenido en la papelera." 126 127 #: inc/post-type.php:39 128 msgid "No posts found." 129 msgstr "No se encontró contenido." 130 131 #: inc/post-type.php:41 132 msgid "Parent Append or Prepend Content:" 51 133 msgstr "" 52 134 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 136 msgid "Please, save the post first in order to select an action." 137 msgstr "Por favor, guarde el contenido antes de seleccionar una opción." 57 138 58 #: class-apporprepp-admin.php:4859 msgctxt " %s is the post type"60 msgid "Append content to %s"61 msgstr " Agregar contenido a %s"139 #: 140 msgctxt "e" 141 msgid "Append " 142 msgstr "" 62 143 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 145 msgctxt "post type singular name" 146 msgid "Append or Prepend Content" 67 147 msgstr "" 68 "Muestra contenido para el tipo %s en las páginas de archivo, búsqueda o "69 "páginas de autor"70 148 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 150 msgctxt "post_type" 151 msgid "Add New" 152 msgstr "Añadir nuevo" 153 154 #: src/components/ActionControl.js:20 155 msgid "Prepend" 156 msgstr "Agregar antes" 157 158 #: inc/post-type.php:38 159 msgid "Search Append or Prepend Content" 160 msgstr "Buscar contenido agregado." 161 162 #: src/components/ActionControl.js:13 163 msgctxt "select an action: prepend/append" 164 msgid "-- Select an option --" 165 msgstr "-- Seleccione una opción --" 166 167 #: inc/admin.php:44 168 msgid "View" 169 msgstr "Ver" 170 171 #: inc/post-type.php:37 172 msgid "View Append or Prepend Content" 173 msgstr "Ver contenido agregado" 174 175 #: inc/admin.php:40 176 msgid "View current appended/prepended content" 177 msgstr "Ver contenido agregado actual" -
append-or-prepend-content/trunk/languages/apporprepp.pot
r2229656 r2656764 1 # Copyright (C) 202 0igmoweb1 # Copyright (C) 202 igmoweb 2 2 # This file is distributed under the GPLv2 or later (license.txt). 3 3 msgid "" 4 4 msgstr "" 5 5 "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" 13 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 8 "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" 16 16 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 28 19 msgid "Append or Prepend Content" 29 20 msgstr "" 30 21 31 #. Plugin URI of the plugin /theme22 #. Plugin URI of the plugin 32 23 msgid "https://wordpress.org/plugins/append-or-prepend-content" 33 24 msgstr "" 34 25 35 #. Description of the plugin /theme26 #. Description of the plugin 36 27 msgid "Add content before or after every post, page or Custom Post Type" 37 28 msgstr "" 38 29 39 #. Author of the plugin /theme30 #. Author of the plugin 40 31 msgid "igmoweb" 41 32 msgstr "" 42 33 43 #. Author URI of the plugin /theme34 #. Author URI of the plugin 44 35 msgid "http://igmoweb.com" 45 36 msgstr "" 46 37 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 39 msgid "View current appended/prepended content" 51 40 msgstr "" 52 41 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 43 msgid "View" 57 44 msgstr "" 58 45 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 47 msgid "Add new content to append/prepend" 63 48 msgstr "" 64 49 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 51 msgid "Add new" 69 52 msgstr "" 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 1 1 === Append or Prepend Content === 2 Contributors: igmoweb , alexandernst2 Contributors: igmoweb 3 3 Tags: content,posts,custom post type 4 Requires at least: 4.0 5 Tested up to: 5.3.2 6 Stable tag: 1.3.1 4 Requires at least: 5.7 5 Tested up to: 5.9 6 Stable tag: 2.0.0 7 Requires PHP: 7.3 7 8 License: GPLv2 or later 8 9 … … 10 11 11 12 == 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.13 Append or Prepend Content allows you to append or prepend content . 13 14 14 15 == Installation == … … 16 17 2. Search for 'Append or Prepend Content' 17 18 3. Activate Append or Prepend Content from your Plugins page. 18 4. Navigate to Settings > Writing and fill the plugin options19 4. Navigate to Settings > Writing and 19 20 20 21 == Screenshots == 21 22 1. **Plugin Settings** 23 22 24 23 25 == Changelog == 26 27 28 24 29 = 1.3.1 = 25 30 Fix: Content was displayed at blog page even if archive option was not selected
Note: See TracChangeset
for help on using the changeset viewer.