-
Notifications
You must be signed in to change notification settings - Fork 5
/
wp-pretty-filters.php
55 lines (48 loc) · 1.22 KB
/
wp-pretty-filters.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
* Plugin Name: WP Pretty Filters
* Plugin URI: https://wordpress.org/plugins/wp-chosen/
* Author: John James Jacoby
* Author URI: https://jjj.blog
* Version: 2.0.0
* Requires at least: 5.3
* Requires PHP: 7.0
* Description: Makes post filters match Media & Attachments
* License: GPLv2 or later
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
/**
* Enqueue scripts
*
* @since 0.1.0
*/
function _wp_pretty_filters() {
// Vars
$url = wp_pretty_filters_get_plugin_url();
$ver = wp_pretty_filters_get_asset_version();
// Styles
wp_enqueue_style( 'wp-pretty-filters', $url . 'assets/css/pretty-filters.css', array(), $ver );
wp_enqueue_script( 'wp-pretty-filters', $url . 'assets/js/pretty-filters.js', array( 'jquery' ), $ver );
}
add_action( 'admin_enqueue_scripts', '_wp_pretty_filters', 11 );
/**
* Return the plugin's URL
*
* @since 0.1.0
*
* @return string
*/
function wp_pretty_filters_get_plugin_url() {
return plugin_dir_url( __FILE__ ) . 'wp-pretty-filters/';
}
/**
* Return the asset version
*
* @since 0.1.0
*
* @return int
*/
function wp_pretty_filters_get_asset_version() {
return 202003090001;
}