GravityView_Admin_Duplicate_View
Class GravityView_Admin_Duplicate_View
Based on the {@link http://lopo.it/duplicate-post-plugin/ Duplicate Post plugin} by Enrico Battocchi - highly recommended!
Since: 1.6
Source: includes/class-gravityview-admin-duplicate-view.php:12
Details
- Kind:
class - Namespace:
(global)
Methods
| Method | Description |
|---|---|
connected_form_links() | Add Duplicate View link to the Data Source metabox |
copy_view_meta_info() | Copy the meta information of a post to another View |
make_duplicate_link_row() | Add the link to action list for post_row_actions |
save_as_new_view_draft() | This function calls the creation of a new copy of the selected post (as a draft) |
save_as_new_view() | This function calls the creation of a new copy of the selected post (by default preserving the original publish status) |
Method Reference
connected_form_links()
function connected_form_links( $links=[], $form=[] )
Add Duplicate View link to the Data Source metabox
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$links | array | [] | Array of link HTML to display in the Data Source metabox |
$form | array | [] | Gravity Forms form array |
Returns
array— If it's the All Views page, return unedited. Otherwise, add a link to create cloned draft of View
Source: includes/class-gravityview-admin-duplicate-view.php:59
copy_view_meta_info()
public function copy_view_meta_info( $new_id, $post )
Copy the meta information of a post to another View
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$new_id | |||
$post | WP_Post | The View that was just cloned | |
$new_view_id | int | The ID of the newly created View |
Returns
void
Since: 1.6
Source: includes/class-gravityview-admin-duplicate-view.php:214
make_duplicate_link_row()
public function make_duplicate_link_row( $actions, $post )
Add the link to action list for post_row_actions
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$actions | array | Row action links. Defaults are 'Edit', 'Quick Edit', 'Restore, 'Trash', 'Delete Permanently', 'Preview', and 'View' | |
$post | WP_Post |
Since: 1.6
Source: includes/class-gravityview-admin-duplicate-view.php:242
save_as_new_view_draft()
public function save_as_new_view_draft()
This function calls the creation of a new copy of the selected post (as a draft)
then redirects to the edit post screen
Returns
void
Since: 1.6
Source: includes/class-gravityview-admin-duplicate-view.php:323
save_as_new_view()
public function save_as_new_view( $status='' )
This function calls the creation of a new copy of the selected post (by default preserving the original publish status)
then redirects to the post list
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$status | string | '' | The status to set for the new View |
Returns
void
Since: 1.6
Source: includes/class-gravityview-admin-duplicate-view.php:335