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

Added improvements #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
target/
dist/
vendor
*.class
*.log
.DS_Store
Thumbs.db
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<?php

?>
// Silence is golden.
3 changes: 0 additions & 3 deletions js/index.php

This file was deleted.

3 changes: 3 additions & 0 deletions js/qsm-custom-addon-admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(function ($) {

}(jQuery));
3 changes: 3 additions & 0 deletions js/qsm-custom-addon-front.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(function ($) {

}(jQuery));
38 changes: 0 additions & 38 deletions php/addon-settings-tab-content.php

This file was deleted.

60 changes: 60 additions & 0 deletions php/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

if (!defined('ABSPATH')) {
exit;
}
if (!class_exists('AddonFunctions_XXXX')) {

class AddonFunctions_XXXX {

public function __construct() {
/**
* Add Hooks & Functions.
*/
//add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'), 9999);
//add_action('wp_enqueue_scripts', array(&$this, 'wp_enqueue_scripts'), 9999);
//add_action('admin_init', 'qsm_addon_XXXX_register_settings_tabs');
//add_action('admin_init', 'qsm_addon_XXXX_register_quiz_settings_tabs');
}

public function admin_enqueue_scripts() {
wp_enqueue_script('qsm-custom-addon-admin-js', QSM_XXXX_ADDON_JS_URL . '/qsm-custom-addon-admin.js', array('jquery'), QSM_XXXX_ADDON_VERSION, true);
wp_enqueue_style('qsm-custom-addon-admin-css', QSM_XXXX_ADDON_CSS_URL . '/qsm-custom-addon-admin.css');
}

public function wp_enqueue_scripts() {
wp_enqueue_script('qsm-custom-addon-front-js', QSM_XXXX_ADDON_JS_URL . '/qsm-custom-addon-front.js', array('jquery'), QSM_XXXX_ADDON_VERSION, true);
wp_enqueue_style('qsm-custom-addon-front-css', QSM_XXXX_ADDON_CSS_URL . '/qsm-custom-addon-front.css');
}

function qsm_get_quiz_url($quiz_id = 0) {
$permalink = '';
if (!empty($quiz_id) && $quiz_id > 0) {
$args = array(
'posts_per_page' => 1,
'post_type' => 'qsm_quiz',
'meta_query' => array(
array(
'key' => 'quiz_id',
'value' => $quiz_id,
'compare' => '=',
),
),
);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) {
while ($the_query->have_posts()) {
$the_query->the_post();
$permalink = get_the_permalink(get_the_ID());
}
wp_reset_postdata();
}
}
return $permalink;
}

}

}
global $AddonFunctions_XXXX;
$AddonFunctions_XXXX = new AddonFunctions_XXXX();
3 changes: 1 addition & 2 deletions php/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<?php

?>
// Silence is golden.
27 changes: 27 additions & 0 deletions php/qsm-addon-settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

if (!defined('ABSPATH'))
exit;

/**
* Registers your tab in the addon settings page
*
* @since 1.0.0
* @return void
*/
function qsm_addon_XXXX_register_addon_settings_tabs() {
global $mlwQuizMasterNext;
if (!is_null($mlwQuizMasterNext) && !is_null($mlwQuizMasterNext->pluginHelper) && method_exists($mlwQuizMasterNext->pluginHelper, 'register_quiz_settings_tabs')) {
$mlwQuizMasterNext->pluginHelper->register_addon_settings_tab("Custom Addon", 'qsm_addon_XXXX_addon_settings_tabs_content');
}
}

/**
* Generates the content for your addon settings tab
*
* @since 1.0.0
* @return void
*/
function qsm_addon_XXXX_addon_settings_tabs_content() {
// Display your addon settings here!
}
29 changes: 29 additions & 0 deletions php/qsm-quiz-settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

if (!defined('ABSPATH')) {
exit;
}

/**
* Registers your tab in the quiz settings page
*
* @since 1.0.0
* @return void
*/
function qsm_addon_XXXX_register_quiz_settings_tabs() {
global $mlwQuizMasterNext;
if (!is_null($mlwQuizMasterNext) && !is_null($mlwQuizMasterNext->pluginHelper) && method_exists($mlwQuizMasterNext->pluginHelper, 'register_quiz_settings_tabs')) {
$mlwQuizMasterNext->pluginHelper->register_quiz_settings_tabs("Sendinblue", 'qsm_addon_XXXX_quiz_settings_tabs_content');
}
}

/**
* Generates the content for your quiz settings tab
*
* @since 1.0.0
* @return void
*/
function qsm_addon_XXXX_quiz_settings_tabs_content() {

// Display your quiz settings here!
}
38 changes: 0 additions & 38 deletions php/quiz-settings-tab-content.php

This file was deleted.

29 changes: 0 additions & 29 deletions php/variables.php

This file was deleted.

113 changes: 0 additions & 113 deletions plugin-name.php

This file was deleted.

Loading