PluginProbe
Advanced Sermons / 3.7
Advanced Sermons v3.7
2.2 2.3 2.4 2.5 2.6 2.7 2.9.1 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 trunk 2.0 2.1
advanced-sermons / advanced-sermons.php

advanced-sermons.php in Advanced Sermons 3.7, at advanced-sermons.php

83 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 Plugin Name: Advanced Sermons
5 Plugin URI: https://advancedsermons.com/
6 Description: Elevate your church's digital outreach with audio/video sermons, organized speakers, and series management.
7 Author: WP Codeus
8 Version: 3.7
9 Author URI: https://wpcodeus.com/
10 License: GPL2
11 Text Domain: advanced-sermons
12 Domain Path: /languages
13 */
14
15 // Exit if accessed directly
16 if ( ! defined( 'ABSPATH' ) ) exit;
17
18 define('ASPPATH', plugin_dir_path(__FILE__));
19 define('ASPURL', plugins_url('', __FILE__));
20
21
22 // Flush permalinks when the plugin is activated
23 function asp_flush_rewrites() {
24 // Explicitly call the function to register the sermon post type and taxonomies
25 asp_register_cpts_sermons();
26 asp_register_taxes_series();
27 asp_register_taxes_sermon_speaker();
28 asp_register_taxes_topics();
29 asp_register_taxes_book();
30 // Now flush rewrite rules
31 flush_rewrite_rules();
32 }
33 register_activation_hook( __FILE__, 'asp_flush_rewrites' );
34
35
36 // The helpers functions for repeated functionalities
37 require( plugin_dir_path( __FILE__ ) . '/include/helpers.php');
38
39
40 // The core plugin file that is used to define internationalization, hooks and functions
41 require( plugin_dir_path( __FILE__ ) . '/include/plugin-functions.php');
42
43
44 // The file that manages admin views and functionality
45 require( plugin_dir_path( __FILE__ ) . '/admin/admin-functions.php');
46
47
48 // The file that manages stylesheets
49 require( plugin_dir_path( __FILE__ ) . '/styling/styling-functions.php');
50
51
52
53 // Get and broadcast the current version of Advanced Sermons
54 $asp_plugin_data = get_file_data(__FILE__, array('Version' => 'Version'), false);
55 $asp_plugin_version = $asp_plugin_data['Version'];
56 global $asp_plugin_version;
57
58
59 // Display additional action links for Advanced Sermons
60 function asp_plugin_add_settings_link( $links ) {
61 $links = array_merge( array(
62 '<a href="' . esc_url( admin_url( 'edit.php?post_type=sermons&page=asp-settings' ) ) . '">' . __( 'Settings', 'advanced-sermons' ) . '</a>',
63 '<a href="https://advancedsermons.com/docs/" target="_blank" >' . __( 'Documentation', 'advanced-sermons' ) . '</a>'
64 ), $links );
65 return $links;
66 }
67 add_action( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'asp_plugin_add_settings_link' );
68
69
70 // Display additional ASP row meta links
71 add_filter( 'plugin_row_meta', 'asp_plugin_add_meta_link', 10, 2 );
72 function asp_plugin_add_meta_link( $links, $file ) {
73 if ( strpos( $file, 'advanced-sermons.php' ) !== false ) {
74 if ( !is_plugin_active('advanced-sermons-pro/advanced-sermons-pro.php') ) {
75 $asp_meta_links = array(
76 'upgrade' => '<a style="color:#cd9f58;" href="https://advancedsermons.com/pricing/" target="_blank">Get Advanced Sermons Pro</a>',
77 );
78 $links = array_merge( $links, $asp_meta_links );
79 }
80 }
81 return $links;
82 }
83