Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
/ WPelements Public archive

A library class for WordPress to facilitate certain tasks when developing plugins.

Notifications You must be signed in to change notification settings

krikke26/WPelements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WPelements

An easy to use Library Class to speed the process of writting wordpress plugin and the structure layout of your plugin.

Install

composer require krike/wp-elements

Usage

You can can create a new instance of the class WP_elements or make a static function call.

$wpelements = new WP_elements();
$wpelements->set_featured_image($file, $post_id)

OR

WP_elements::set_featured_image($file, $post_id)

Available functions:

Function Description
openWrapper(title,(optional)iconName) Opens a wrapper box for the admin page. (requires closeWrapper() at the end of your code) WP_elements::openWrapper('Page title', 'themes');
closeWrapper() Closes the wrapper box for the admin page WP_elements::closeWrapper()
openForm() openForm($action = '', $method = 'post', $enctype = false, $id = '')
closeForm() closeForm()
openTableWrapper() openTableWrapper($title, $icon = false, $class = 'options', $columns = 3)
closeTableWrapper() closeTableWrapper($columns = 3, $submit = array('btn_name' => 'submit', 'btn_title' => 'Update Options'))
loadView() loadView($paths, $data = null)
set_value() set_value($value, $default_value)
set_form_value() set_form_value($name, $default_value)
if_checked() if_checked($value)
if_selected() if_selected($value)
createSlug() createSlug($slug)
getFileContent() getFileContent($path)
jsonResponseOutput() jsonResponseOutput($response)
input_field() input_field($type = 'text', $name, $label, $params = null)
textarea_field() textarea_field($name, $label, $params = null)
select_field() select_field($options, $name, $label, $params = null)
minifyCode() minifyCode($code)
uploadDownloadFiles() uploadDownloadFiles($fieldName, $supported_types, $optional = false)
set_featured_image() set_featured_image($file, $post_id)
check_upload_folder() check_upload_folder($folderName)
filter_options() filter_options()

Coming in next update

  • Twig ready functions

License

This Library Class is licensed under GPL and can be used in both personal and commercial applications.

About

A library class for WordPress to facilitate certain tasks when developing plugins.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages