Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea to customize URL #28

Open
kalicki opened this issue Jul 16, 2015 · 0 comments
Open

Idea to customize URL #28

kalicki opened this issue Jul 16, 2015 · 0 comments

Comments

@kalicki
Copy link

kalicki commented Jul 16, 2015

It is interesting to use constant in URL, this allows me to change or custom by the theme

E.g.:

public function __construct() {
        if ( ! defined( 'PW_CMB2_Field_Google_Maps_URL' ) ) {
            define( 'PW_CMB2_Field_Google_Maps_URL', plugin_dir_url( __FILE__ ) );
        }
        add_filter( 'cmb2_render_pw_map', array( $this, 'render_pw_map' ), 10, 5 );
        add_filter( 'cmb2_sanitize_pw_map', array( $this, 'sanitize_pw_map' ), 10, 4 );
    }
public function setup_admin_scripts() {
        wp_register_script( 'pw-google-maps-api', '//maps.googleapis.com/maps/api/js?sensor=false&libraries=places', null, null );
        wp_enqueue_script( 'pw-google-maps', PW_CMB2_Field_Google_Maps_URL . 'js/script.js', array( 'pw-google-maps-api' ), self::VERSION );
        wp_enqueue_style( 'pw-google-maps', PW_CMB2_Field_Google_Maps_URL . 'css/style.css', array(), self::VERSION );
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant