Skip to content

Commit

Permalink
Version 3.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
enricobattocchi committed Jul 7, 2020
1 parent 8adb98f commit c75418d
Show file tree
Hide file tree
Showing 22 changed files with 1,207 additions and 449 deletions.
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/.* export-ignore
svn-assets export-ignore
CHANGELOG export-ignore
composer.* export-ignore
Gruntfile.js export-ignore
LICENSE export-ignore
package.json export-ignore
package-lock.json export-ignore
phpcs.xml export-ignore
phpunit.* export-ignore
README.md export-ignore
README.wordpress.md export-ignore
tests export-ignore
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Yoast Duplicate Post

[![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/duplicate-post.svg)](https://wordpress.org/plugins/duplicate-post/) ![WordPress Plugin: Tested WP Version](https://img.shields.io/wordpress/plugin/tested/duplicate-post.svg) [![WordPress Plugin Active Installs](https://img.shields.io/wordpress/plugin/installs/duplicate-post.svg)](https://wordpress.org/plugins/duplicate-post/advanced/) [![WordPress Plugin Downloads](https://img.shields.io/wordpress/plugin/dt/duplicate-post.svg)](https://wordpress.org/plugins/duplicate-post/advanced/) [![WordPress Plugin Rating](https://img.shields.io/wordpress/plugin/stars/duplicate-post.svg)](https://wordpress.org/support/plugin/duplicate-post/reviews/) [![GitHub](https://img.shields.io/github/license/Yoast/duplicate-post.svg)](https://github.com/Yoast/duplicate-post/blob/future/LICENSE) [![Build Status](https://travis-ci.org/enricobattocchi/duplicate-post.svg?branch=master)](https://travis-ci.org/Yoast/duplicate-post) [![RIPS CodeRisk](https://coderisk.com/wp/plugin/duplicate-post/badge "RIPS CodeRisk")](https://coderisk.com/wp/plugin/duplicate-post)

> Duplicate Post plugin for WordPress https://yoast.com/wordpress/plugins/duplicate-post/
This WordPress plugin allows users to clone posts of any type, or copy them to new drafts for further editing.

This document addresses the GitHub repository. WordPress.org uses the [readme.txt file](readme.txt).

- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
- [License](#license)

## Install

### Automatic install from WordPress Dashboard

1. Click on _Plugins__Add New_;
2. Search for "Duplicate Post" using the top right searchbox;
3. Click on the _Install Now_ button;
4. Click on _Activate_;
5. Go to _Settings__Duplicate Post_ and customize behaviour as needed.

### Install using zipfile

1. Download the archive from https://wordpress.org/plugins/duplicate-post/ (latest stable) or the [latest snapshot ZIP](https://github.com/Yoast/duplicate-post/archive/master.zip) from GitHub;
2. Unzip the archive on your computer;
3. Upload the `duplicate-post` directory into the `/wp-content/plugins/` directory;
4. Activate the plugin through the _Plugins_ page in WordPress Dashboard;
5. Go to _Settings__Duplicate Post_ and customize behaviour as needed.

## Usage

1. In _Edit Posts_/_Edit Pages_, you can click on _Clone_ link below the post/page title: this will immediately create a copy and return to the list.
2. In _Edit Posts_/_Edit Pages_, you can select one or more items, then choose _Clone_ in the _Bulk Actions_ dropdown to copy them all at once.
3. In _Edit Posts_/_Edit Pages_, you can click on _New Draft_ link below the post/page title.
4. On the post edit screen, you can click on _Copy to a new draft_ above _Cancel_/_Move to trash_ or in the admin bar.
5. While editing a post or viewing it as a logged-in user, you can click on _Copy to a new draft_ in the admin bar.

3, 4 and 5 will lead to the edit page for the new draft: change what you want, click on 'Publish' and you're done.

There is also a **template tag**, so you can put it in your templates and clone your posts/pages from the front-end. Clicking on the link will lead you to the edit page for the new draft, just like the admin bar link.

## API

For functions, template tags and hooks refer to the [Developer's Guide](https://developer.yoast.com/duplicate-post/) on our developer site.

## Maintainer

The Duplicate Post plugin was created by Enrico Battocchi ([Lopo](https://lopo.it)). It's maintained by Team Yoast, of which Enrico is now a part.

## Contributing

If you find this useful and if you want to contribute, there are three ways:

1. You can submit your bug reports, suggestions and requests for features [on GitHub](https://github.com/Yoast/duplicate-post/);
2. You can also [submit a pull request](https://github.com/Yoast/duplicate-post/pulls);
3. If you want to translate it to your language (there are just a few lines of text), you can use the [translation project](https://translate.wordpress.org/projects/wp-plugins/duplicate-post);

## License

[GPL v2.0 © Yoast BV](LICENSE)
14 changes: 7 additions & 7 deletions compat/duplicate-post-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@


function duplicate_post_jetpack_init() {
add_filter('duplicate_post_blacklist_filter', 'duplicate_post_jetpack_add_to_blacklist', 10, 1 );
add_filter('duplicate_post_excludelist_filter', 'duplicate_post_jetpack_add_to_excludelist', 10, 1 );

if (class_exists('WPCom_Markdown')){
add_action('duplicate_post_pre_copy', 'duplicate_post_jetpack_disable_markdown', 10);
add_action('duplicate_post_post_copy', 'duplicate_post_jetpack_enable_markdown', 10);
}
}
}

function duplicate_post_jetpack_add_to_blacklist($meta_blacklist) {
function duplicate_post_jetpack_add_to_excludelist($meta_blacklist) {
$meta_blacklist[] = '_wpas*'; //Jetpack Publicize
$meta_blacklist[] = '_publicize*'; //Jetpack Publicize

$meta_blacklist[] = '_jetpack*'; //Jetpack Subscriptions etc.

return $meta_blacklist;
}

Expand All @@ -27,4 +27,4 @@ function duplicate_post_jetpack_disable_markdown(){

function duplicate_post_jetpack_enable_markdown(){
WPCom_Markdown::get_instance()->load_markdown_for_posts();
}
}
Loading

0 comments on commit c75418d

Please sign in to comment.