{"id":75274,"date":"2017-09-27T12:18:53","date_gmt":"2017-09-27T12:18:53","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/sensei-degree-of-difficulty\/"},"modified":"2017-09-27T12:18:53","modified_gmt":"2017-09-27T12:18:53","slug":"degree-of-difficulty-for-sensei","status":"publish","type":"plugin","link":"https:\/\/zgh.wordpress.org\/plugins\/degree-of-difficulty-for-sensei\/","author":15682535,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"trunk","tested":"4.8.28","requires":"4.4","requires_php":"","requires_plugins":"","header_name":"Degree of Difficulty for Sensei","header_author":"Open-DSI","header_description":"Sensei LMS add-on to set and display the degree of difficulty of a course.","assets_banners_color":"","last_updated":"2017-09-27 12:18:53","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/git.open-dsi.fr\/wordpress-plugin\/degree-of-difficulty-for-sensei","header_author_uri":"https:\/\/www.open-dsi.fr\/","rating":0,"author_block_rating":0,"active_installs":10,"downloads":2148,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":{"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1746054","resolution":"256x256","location":"assets"},"icon-512x512.png":{"filename":"icon-512x512.png","revision":"1746054","resolution":"512x512","location":"assets"}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1746054","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1746054","resolution":"2","location":"assets"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1746054","resolution":"3","location":"assets"},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"1746054","resolution":"4","location":"assets"},"screenshot-5.png":{"filename":"screenshot-5.png","revision":"1746054","resolution":"5","location":"assets"}},"screenshots":{"1":"Degree of Difficulty icons displayed next to the WooCommerce course product price.","2":"Degree of Difficulty tooltip displayed when hovering the icon.","3":"Degrees of Difficulty administration screen.","4":"Edit a Degree of Difficulty.","5":"Add a Degree of Difficulty to your Sensei course."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[8102,127245,2195,50978,609],"plugin_category":[57],"plugin_contributors":[147063],"plugin_business_model":[],"class_list":["post-75274","plugin","type-plugin","status-publish","hentry","plugin_tags-course","plugin_tags-difficulty","plugin_tags-lms","plugin_tags-sensei","plugin_tags-tags","plugin_category-taxonomy","plugin_contributors-opendsi","plugin_committers-opendsi"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/degree-of-difficulty-for-sensei\/assets\/icon-256x256.png?rev=1746054","icon_2x":"https:\/\/ps.w.org\/degree-of-difficulty-for-sensei\/assets\/icon-256x256.png?rev=1746054","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/degree-of-difficulty-for-sensei\/assets\/screenshot-1.png?rev=1746054","caption":"Degree of Difficulty icons displayed next to the WooCommerce course product price."},{"src":"https:\/\/ps.w.org\/degree-of-difficulty-for-sensei\/assets\/screenshot-2.png?rev=1746054","caption":"Degree of Difficulty tooltip displayed when hovering the icon."},{"src":"https:\/\/ps.w.org\/degree-of-difficulty-for-sensei\/assets\/screenshot-3.png?rev=1746054","caption":"Degrees of Difficulty administration screen."},{"src":"https:\/\/ps.w.org\/degree-of-difficulty-for-sensei\/assets\/screenshot-4.png?rev=1746054","caption":"Edit a Degree of Difficulty."},{"src":"https:\/\/ps.w.org\/degree-of-difficulty-for-sensei\/assets\/screenshot-5.png?rev=1746054","caption":"Add a Degree of Difficulty to your Sensei course."}],"raw_content":"<!--section=description-->\n<p>Courses will have a new tag to set their Degree of Difficulty. You can choose between 3 predefined options: Beginner, Intermediate and Advanced.\nYou can add, edit or remove your own degrees of difficulty by going to \"Courses &gt; Degrees of Difficulty\" from the menu.<\/p>\n\n<p>Upload and display an image (or icons, pictograms) for your degree of difficulty (thanks to John James Jacoby and his <a href=\"https:\/\/wordpress.org\/plugins\/wp-term-images\/\">WP Term Images<\/a> plugin!).<\/p>\n\n<p>Degrees of Difficulty can be displayed by your theme using the <code>dds_get_sensei_course_degrees_of_difficulty()<\/code> function.<\/p>\n\n<!--section=installation-->\n<p>Installing \"Degree of Difficulty for Sensei\" can be done either by searching for \"Degree of Difficulty for Sensei\" via the \"Plugins &gt; Add New\" screen in your WordPress dashboard, or by using the following steps:<\/p>\n\n<ol>\n<li>Download the plugin via WordPress.org<\/li>\n<li>Upload the ZIP file through the 'Plugins &gt; Add New &gt; Upload' screen in your WordPress dashboard<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><p>Installing \"Degree of Difficulty for Sensei\" can be done either by searching for \"Degree of Difficulty for Sensei\" via the \"Plugins &gt; Add New\" screen in your WordPress dashboard, or by using the following steps:<\/p>\n\n<ol>\n<li>Download the plugin via WordPress.org<\/li>\n<li>Upload the ZIP file through the 'Plugins &gt; Add New &gt; Upload' screen in your WordPress dashboard<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol><\/dd>\n<dt>Does this plugin depend on any others?<\/dt>\n<dd><p>Yes. It depends on the <a href=\"https:\/\/woocommerce.com\/products\/sensei\/\">Sensei<\/a> LMS plugin.<\/p><\/dd>\n<dt>Does this create new database tables?<\/dt>\n<dd><p>No. There are no new database tables with this plugin.<\/p><\/dd>\n<dt>Does this load additional JS or CSS files ?<\/dt>\n<dd><p>Yes. It loads the <code>term-image.css<\/code> and <code>term-image.js<\/code> files on the admin screens related to Degree of Difficulty.\nThose files are loaded by the WP Term Images plugin which comes included.<\/p><\/dd>\n<dt>Can I add an icon to my degree of difficulty?<\/dt>\n<dd><p>Yes. Click on the \"Choose Image\" button when adding or editing a Degree of Difficulty.<\/p>\n\n<p>Sample icons are available in the <code>assets\/images\/<\/code> plugin folder.<\/p><\/dd>\n<dt>How do I display the degree of difficulty of a course?<\/dt>\n<dd><p>The plugin comes with an helper function named <code>dds_get_sensei_course_degree_of_difficulty()<\/code>.\nIt accepts a Sensei course ID or a WooCommerce product ID as first argument.<\/p>\n\n<p>Choose where you would like to display degrees of difficulty and make use of that function in your theme's <code>functions.php<\/code> file.\nHere is a complete example to display the degree of difficulty next to the WooCommerce product price:<\/p>\n\n<pre><code>\/**\n * WooCommerce template:\n * Add Sensei course degree(s) of difficulty\n *\n * @uses dds_get_sensei_course_degrees_of_difficulty()\n *\/\nfunction mytheme_woocommerce_sensei_course_degrees_of_difficulty() {\n    global $product;\n\n    \/\/ Check product has a Sensei course.\n    \/\/ Get Sensei course where WooCommerce product ID === course_woocommerce_product.\n    $product_id = $product-&gt;get_id();\n\n    if ( ! function_exists( 'dds_get_sensei_course_degrees_of_difficulty' ) ) {\n        return;\n    }\n\n    $is_woocommerce_product = true;\n\n    \/**\n     * Our course degrees of difficulty.\n     *\n     * @var array Array of arrays. Degree of difficulty array will provide id, name, slug &amp; image_url.\n     *\/\n    $degrees_of_difficulty = dds_get_sensei_course_degrees_of_difficulty( $product_id, $is_woocommerce_product );\n\n    if ( ! $degrees_of_difficulty ) {\n        return;\n    }\n\n    foreach ( (array) $degrees_of_difficulty as $difficulty ) {\n\n        $classes = 'mytheme-difficulty ' . $difficulty['slug'];\n\n        $title = 'Degree of Difficulty: ' . $difficulty['name'];\n        ?&gt;\n        &lt;span class=\"mytheme-difficulty-wrapper\"&gt;\n            &lt;span class=\"&lt;?php esc_attr_e( $classes ); ?&gt;\" title=\"&lt;?php esc_attr_e( $title ); ?&gt;\"&gt;\n                &lt;?php if ( $difficulty['image_url'] ) : ?&gt;\n                    &lt;img src=\"&lt;?php esc_attr_e( $difficulty['image_url'] ); ?&gt;\" alt=\"&lt;?php esc_attr_e( $title ); ?&gt;\" \/&gt;\n                &lt;?php else : ?&gt;\n                    &lt;?php esc_html_e( $difficulty['name'] ); ?&gt;\n                &lt;?php endif; ?&gt;\n            &lt;\/span&gt;\n        &lt;\/span&gt;\n        &lt;?php\n    }\n}\n\n\/**\n * Add Sensei course degree(s) of difficulty after product price.\n *\n * woocommerce_template_single_price hook has priority 10\n *\/\nadd_action( 'woocommerce_single_product_summary', 'mytheme_woocommerce_sensei_course_degrees_of_difficulty', 15 );\n\n\/**\n * Add Sensei course degree(s) of difficulty after product price.\n *\n * woocommerce_template_loop_price hook has priority 10\n *\/\nadd_action( 'woocommerce_after_shop_loop_item_title', 'mytheme_woocommerce_sensei_course_degrees_of_difficulty', 15 );\n<\/code><\/pre><\/dd>\n<dt>Is the plugin translated?<\/dt>\n<dd><p>Yes. It is translated in French (fr_FR).\nYou will find the translation files in the <code>lang\/<\/code> folder.\nNew translations are welcome at https:\/\/translate.wordpress.org\/projects\/wp-plugins\/degree-of-difficulty-for-sensei<\/p><\/dd>\n<dt>Where can I get support?<\/dt>\n<dd><p>https:\/\/wordpress.org\/support\/plugin\/degree-of-difficulty-for-sensei\/<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>2017-10-09<\/li>\n<li>Fix Add dds_ prefix to WP Term Images functions in case plugin already installed.<\/li>\n<li>Fix Add DDS_ prefix to WP Term Images classes in case plugin already installed.<\/li>\n<li>Dynamic slug Degree_of_Difficulty_for_Sensei()-&gt;slug in degree-of-difficulty-for-sensei-functions.php<\/li>\n<li>Add 2 new icon sets in assets\/images\/<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>2017-09-25<\/li>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Sensei LMS add-on to set and display the degree of difficulty of a course.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/75274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=75274"}],"author":[{"embeddable":true,"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/opendsi"}],"wp:attachment":[{"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=75274"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=75274"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=75274"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=75274"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=75274"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/zgh.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=75274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}