Code Monkey home page Code Monkey logo

learndash-quiz-hooks-generator's Introduction

LearnDash Quiz Hooks Generator

LearnDash Quiz Hooks Generator is a LearnDash addon which facilitates to create custom hooks for LearnDash Quiz, these custom hooks could be used by developers to easily customize and extend the capabilities of LearnDash Quiz. It can serve as the missing piece for the hooks which are not available in the default LearnDash installation and could help to meet client specific requirements without core hacking of LearnDash.

Navigate here, wp-content/plugins/sfwd-lms/includes/vendor/wp-pro-quiz/lib

All the files inside this directory can be overridden and used to add the custom hooks, you will have to place the files with the same directory structure here,

wp-content/plugins/learndash_quiz_hooks_generator/lib

To get started, one custom hook is already created through this addon, more can be created by developers according to their specific needs. See the sample WpProQuiz_Model_QuestionMapper.php file insde the model folder in the above path, you will have to just follow the same approach to override any other file.

As soon as you place the file correctly, the files placed inside the hook generator plugin will be loaded instead of the default LearnDash file. You can now modify the file to create your own hooks. Notice the sample hook "learndash_quiz_questions" inside the file wp-content/plugins/learndash_hooks_generator/lib/model/ WpProQuiz_Model_QuestionMapper.php as an example.

A custom filter is already created with the plugin install. You will be able to modify the quiz questions displayed in LearnDash Quiz using this custom filter. This wasn't possible by default, as LearnDash provides no hook for this.

After plugin install, you can use this filter anywhere now,

add_filter("learndash_quiz_questions", function( $quiz_data ) {});

$quiz_data holds quiz questions to be displayed in your LearnDash Quiz you can alter them according to your specific development needs through this hook.

Installation

Before installation please make sure you have latest LearnDash installed.

  1. Upload the plugin files to the /wp-content/plugins/ directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress

learndash-quiz-hooks-generator's People

Contributors

adeel-raza avatar the-wooninjas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.