| @@ -8,8 +8,10 @@ | ||
| 8 | 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 9 | * @since 1.8.13 |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | +use Give\DonationForms\V2\DonationFormsAdminPage; | |
| 13 | + | |
| 12 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | 15 | exit; |
| 14 | 16 | } |
| 15 | 17 | |
| @@ -215,17 +217,19 @@ | ||
| 215 | 217 | * @return bool True if post exists, otherwise false. |
| 216 | 218 | */ |
| 217 | 219 | private function post_exists( $post_type ) { |
| 218 | 220 | // Attempt to get a single post of the post type. |
| 219 | - $query = new WP_Query( array( | |
| 220 | - 'post_type' => $post_type, | |
| 221 | - 'posts_per_page' => 1, | |
| 222 | - 'no_found_rows' => false, | |
| 223 | - 'update_post_meta_cache' => false, | |
| 224 | - 'update_post_term_cache' => false, | |
| 225 | - 'fields' => 'ids', | |
| 226 | - 'post_status' => array( 'any', 'trash' ), | |
| 227 | - ) ); | |
| 221 | + $query = new WP_Query( | |
| 222 | + array( | |
| 223 | + 'post_type' => $post_type, | |
| 224 | + 'posts_per_page' => 1, | |
| 225 | + 'no_found_rows' => false, | |
| 226 | + 'update_post_meta_cache' => false, | |
| 227 | + 'update_post_term_cache' => false, | |
| 228 | + 'fields' => 'ids', | |
| 229 | + 'post_status' => array( 'any', 'trash' ), | |
| 230 | + ) | |
| 231 | + ); | |
| 228 | 232 | |
| 229 | 233 | return $query->have_posts(); |
| 230 | 234 | } |
| 231 | 235 | |
| @@ -252,14 +256,15 @@ | ||
| 252 | 256 | */ |
| 253 | 257 | private function get_content( $context ) { |
| 254 | 258 | // Define default content. |
| 255 | 259 | $defaults = array( |
| 256 | - 'image_url' => GIVE_PLUGIN_URL . 'assets/dist/images/give-icon-full-circle.svg', | |
| 257 | - 'image_alt' => __( 'Give Icon', 'give' ), | |
| 258 | - 'heading' => __( 'No donation forms found.', 'give' ), | |
| 259 | - 'message' => __( 'The first step towards accepting online donations is to create a form.', 'give' ), | |
| 260 | - 'cta_text' => __( 'Create Donation Form', 'give' ), | |
| 261 | - 'cta_link' => admin_url( 'post-new.php?post_type=give_forms' ), | |
| 260 | + 'image_url' => GIVE_PLUGIN_URL . 'build/assets/dist/images/give-icon-full-circle.svg', | |
| 261 | + 'image_alt' => __( 'GiveWP Icon', 'give'), | |
| 262 | + 'heading' => __('No campaign forms found.', 'give'), | |
| 263 | + 'message' => __('The first step towards accepting online donations is to create a campaign.', | |
| 264 | + 'give'), | |
| 265 | + 'cta_text' => __('Create Campaign Form', 'give'), | |
| 266 | + 'cta_link' => admin_url('edit.php?post_type=give_forms&page=give-campaigns&new=campaign'), | |
| 262 | 267 | 'help' => sprintf( |
| 263 | 268 | /* translators: 1: Opening anchor tag. 2: Closing anchor tag. */ |
| 264 | 269 | __( 'Need help? Get started with %1$sGive 101%2$s.', 'give' ), |
| 265 | 270 | '<a href="http://docs.givewp.com/give101/" target="_blank">', |
| @@ -276,9 +281,9 @@ | ||
| 276 | 281 | 'no_donations' => array( |
| 277 | 282 | 'heading' => __( 'No donations found.', 'give' ), |
| 278 | 283 | 'message' => __( 'When your first donation arrives, a record of the donation will appear here.', 'give' ), |
| 279 | 284 | 'cta_text' => __( 'View All Forms', 'give' ), |
| 280 | - 'cta_link' => admin_url( 'edit.php?post_type=give_forms' ), | |
| 285 | + 'cta_link' => DonationFormsAdminPage::getUrl(), | |
| 281 | 286 | 'help' => sprintf( |
| 282 | 287 | /* translators: 1: Opening anchor tag. 2: Closing anchor tag. */ |
| 283 | 288 | __( 'Need help? Learn more about %1$sDonations%2$s.', 'give' ), |
| 284 | 289 | '<a href="http://docs.givewp.com/core-donations/">', |
| @@ -292,9 +297,9 @@ | ||
| 292 | 297 | 'no_donors' => array( |
| 293 | 298 | 'heading' => __( 'No donors found.', 'give' ), |
| 294 | 299 | 'message' => __( 'When your first donation arrives, the donor will appear here.', 'give' ), |
| 295 | 300 | 'cta_text' => __( 'View All Forms', 'give' ), |
| 296 | - 'cta_link' => admin_url( 'edit.php?post_type=give_forms' ), | |
| 301 | + 'cta_link' => DonationFormsAdminPage::getUrl(), | |
| 297 | 302 | 'help' => sprintf( |
| 298 | 303 | /* translators: 1: Opening anchor tag. 2: Closing anchor tag. */ |
| 299 | 304 | __( 'Need help? Learn more about %1$sDonors%2$s.', 'give' ), |
| 300 | 305 | '<a href="http://docs.givewp.com/core-donors/">', |