Giter Club home page Giter Club logo

wp-plugin-starter's People

Contributors

joshcummingsdesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wp-plugin-starter's Issues

How do I make an ajax call?

Hi, I found your plugin is quite helpful and fast in creating plugin.

I got an issue, how do I make an ajax call? I've created plugin-name/includes/class-admin-ajax.php and placed my wp_ajax_ hook there, but seems like the hook is not recognized yet.

class-admin-ajax.php

<?php 
add_action('wp_ajax_test', 'test');
function test(){ die('yay'); }

javascript section

<script>
    jQuery(document).ready(function ($) {
        $('#submit').click(function () {
            var url = ajaxurl + "?action=test";
            $.get( url, function () {

            });
        })
    })
</script>

Can you point out where are my mistakes?

Documentation

Need to provide better documentation, for example you can override the view in the partials folder.

Activation Issue

Hey when trying to install without modifying anything yet. I got this error.

Can't use function return value in write context in /wp-content/plugins/testimonials/includes/class-activator.php on line 15

and that line is if( empty (get_option($option_name)) )

what I have found is

https://stackoverflow.com/a/4328049/8260463

empty() needs to access the value by reference (in order to check whether that reference points to something that exists), and PHP before 5.5 didn't support references to temporary values returned from functions. I am on version 7.1 so this shouldn't be an issue.

PHP doesn't have concept of emptyness. Values that evaluate to false are empty, values that evaluate to true are non-empty.

Return value from the method always exists (even if you don't have return statement, return value exists and contains null).

From what I understand about get_option() it will return false if no option is set. so then empty(false) returns null and WordPress tries to use that.

so changing to if( !(get_option($option_name)) ) worked for me, not sure if that's the best solution

Consider switching to CMB2

CMB2 provides a nice API for creating meta boxes. We have a "WordPress way" implementation here, but CMB2 has a lot more field types which would save us a lot of work here.

Validation

Need to provide a method for validation and sanitization of input fields.

Is there is any way to remove hook?

Thanks, this starter plugin is very helpful. But i didn't find a way to remove hooks. Please provide an example if anyone have done this.

Kind regards,

Add docs for shortcode

Some frontend code will be powered by shortcodes or will be called in different hooks. Right now the render method is being called in the 'wp_footer' hook. This needs to be clearly documented.

Continuous Integration

It would be nice to have a system that runs tests and auto-deploys to the update server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.