How would WP plugins need to be recoded in order to work on Modx?

两盒软妹~` 提交于 2019-12-12 03:47:21

问题


Lets say, I want an affiliate plugin that I bought for WP to work on Modx. What are the procedures to follow? Yes, you can assume that all the plugins I bought use php, javascript, and jquery.


回答1:


You need to refactoring your plugin to modx snippets and chunks - http://www.cmslesstraveled.com/index/tutorials/refactoring-a-simple-php-application-for-modx.html




回答2:


You can use internal Wordpress functions by including this file include_once($_SERVER['DOCUMENT_ROOT'].'/wp-load.php' );

You can try including the file in one of your modx templates and then see if it gives you access to your affiliate plugin functions.

Vice-Versa you could include modx into your wordpress theme files by adding this code.

define('MODX_CORE_PATH', 'full/path/to/your/modx/core/'); define('MODX_CONFIG_KEY', 'config'); require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; $modx= new modX(); $modx->initialize('mgr');

This will give you access to the $modx object and all it's wonders.

Source: http://www.quora.com/MODX-CMS/How-would-WordPress-plugins-need-to-be-recoded-in-order-to-work-in-MODX



来源:https://stackoverflow.com/questions/13771738/how-would-wp-plugins-need-to-be-recoded-in-order-to-work-on-modx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!