Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Connecting To Loan Company API

Discussion in 'Misc WordPress Requests' started by RossMitchell, Mar 11, 2018.

  1. RossMitchell


    Reply To: Connecting To Loan Company API, by RossMitchell

    Not sure that there is that much to know.
    I am sure there is a doc somewhere, not sure I have read it. Found it now, on this page: https://codex.wordpress.org/Main_Page
    Is a section “Write a Plugin” with three parts:

    When I started I had much more experience reading PHP than writing it. Please read the sample that launched me:
    Yes it has nearly 700 lines, but spend 5 minutes scrolling through it, plant memories like “so that is how xxx happens”, so that you can get back to it later.
    You will see that there is a php file with the same name as the directory, so give your plugin a distinct name.
    It is possible that you don’t need any options or configuration for the plugin, so all that can get removed.

    //your shorcode stuff need not have anything to do with much else, may I suggest
    // something like this:

    class ABC_class {
    private $varA; //all the classes private variables
    private $varB;
    public function __construct() {
    $this->varA = "";
    private function reset() {
    $this->varB = "";
    private function support_fn() {
    public function do_foobar() {
    //the shortcode gets done here

    function foobar_func( $atts ){
    //supply custom loan API
    $mru = new ABC_class();
    add_shortcode( 'foobar', 'foobar_func' );

    Reply To: Connecting To Loan Company API

Share This Page

Monarch Social Sharing Plugin